Results 1 to 4 of 4

Thread: DUH?!?!?

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jul 2000
    Location
    Lost in the Mojave Desert
    Posts
    82

    Unhappy

    getting "missing operator in sql query" anyon egot an idea?






    sSQL1 = "SELECT * FROM [Service Calls] WHERE [Service Calls.Date] BETWEEN #" & sDateFrom & "# AND #" & sDateTo & "# INNER JOIN [Service Calls] ON [Customer Info.Cust ID Number] = [Service Calls.Cust ID Number] SORT BY Date,Time"

  2. #2
    Guru Clunietp's Avatar
    Join Date
    Oct 1999
    Location
    USA
    Posts
    1,844
    try changing this:
    SORT BY Date,Time

    to this:
    ORDER BY [Date], [Time]

  3. #3
    Frenzied Member
    Join Date
    Aug 1999
    Location
    Santa Clara, Ca , 95058
    Posts
    1,105
    You may need to qualify the tables the sort fields belong to...

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Jul 2000
    Location
    Lost in the Mojave Desert
    Posts
    82
    already qualified the order by but still getting attitude
    basically trying to combine 2 tables into an object and selecting recordsets based on the date and then sorting them out heres what i got so far:

    'sSQL1 = "SELECT * FROM [Customer Info] WHERE [Cust ID Number] in( SELECT [Cust ID Number] FROM Appointments WHERE Appointments.Date BETWEEN #" & sDateFrom & "# And #" & sDateTo & "# )"
    'sSQL1 = "SELECT * FROM Appointments WHERE Date BETWEEN #" & sDateFrom & "# AND #" & sDateTo & "# ORDER BY Appointments.Date,Appointments.Time"
    sSQL1 = "SELECT * FROM Appointments WHERE Date BETWEEN #" & sDateFrom & "# AND #" & sDateTo & "# ORDER BY Appointments.Date,Appointments.Time WHERE [Cust Info] WHERE [Cust Info.Cust ID Number]=[Appointments.Cust ID Number]"


    Set apptRSResult = mdiDBMain.objDataBase.OpenRecordset(sSQL1, dbOpenSnapshot) 'new rs from sdatefrom to sdateto

Posting Permissions

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



Click Here to Expand Forum to Full Width