Question On SQL Server Query

Results 1 to 3 of 3

Thread: Question On SQL Server Query

  1. #1
    Join Date
    Dec 1969

    Default Question On SQL Server Query

    I am using SQL Server 7 and trying to run this query. Please help if you can find the error. Thanks!<BR><BR>SELECT DISTINCTROW DEPARTMENTS.ID, DEPARTMENTS.NAME FROM DEPARTMENTS, SCHEDULE WHERE (DEPARTMENTS.ID = SCHEDULE.DEPARTMENT AND ((DEPARTMENTS.CENTER)=&#039MFLD&#039) AND ((SCHEDULE.PROVIDER) Is Not Null)) ORDER BY DEPARTMENTS.NAME; <BR><BR>Microsoft OLE DB Provider for ODBC Drivers error &#039 80040e14&#039 <BR><BR>[Microsoft][ODBC SQL Server Driver][SQL Server]Line 1: Incorrect syntax near &#039.&#039. <BR>

  2. #2 Guest

    Default Not very helpful error message!

    I have examined your SQL and can see nothing wrong. It looks like there are some superfluous brackets around fieldnames:<BR>"(DEPARTMENTS.CENTER)" and "(SCHEDULE.PROVIDER)"<BR>but don&#039t think this should stop it.<BR><BR>Why don&#039t you try running it against the database (using ISQL.exe, not in ASP)? <BR><BR>Also seeing it is indicating the error is at a ".", remove the table qualifiers on selected fields (eg "DEPARTMENTS.ID" becomes just "ID"). Note you can only do this on fields names that don not exist in both tables. If you take out the tablename qualifiers one at a time you may find which is the offending dot.<BR><BR>

  3. #3
    Garth Guest

    Default RE: Question On SQL Server Query


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts