Results 1 to 19 of 19

Thread: sql error in statement (resolved - I GOT IT!)

Threaded View

  1. #1

    Thread Starter
    Addicted Member fenster's Avatar
    Join Date
    Apr 2003
    Location
    Glasgow,Scotland
    Posts
    201

    sql error in statement (resolved - I GOT IT!)

    hi guys..

    im trying to pull all records from my DB (acesss 2000) where

    customername is = string
    orderstatus is = string
    datecomplete is => string
    datecomplete is <= string

    maybe the join is wrong because i need to join table job and transaction by jobid (primary key)


    heres my sql statement
    Code:
        ssql = "SELECT"
        ssql = ssql & " Customer.Name,"
        ssql = ssql & " job.orderdate,"
        ssql = ssql & " Job.PatientName,"
        ssql = ssql & " Job.[Item Description],"
        ssql = ssql & " Job.jobcode,"
        ssql = ssql & " Job.Order_Status,"
        ssql = ssql & " Job.TrayNumber,"
        ssql = ssql & " Job.JobNumber,"
        ssql = ssql & " Job.JobID,"
        ssql = ssql & " Job.custid,"
        ssql = ssql & " Job.jobcode"
        ssql = ssql & " FROM"
        ssql = ssql & " Customer"
        ssql = ssql & " INNER JOIN"
        ssql = ssql & " Job ON Customer.CustID = Job.CustID"
        ssql = ssql & " WHERE (((Customer.Name) = '" & CUSTTOFIND & "'))"
        ssql = ssql & " AND "
        ssql = ssql & " (((Job.Order_Status) = '" & sType & "'))"
        ssql = ssql & " AND "
        ssql = ssql & " (((transaction.datecomplete) => '" & startdate & "'))"
        ssql = ssql & " AND "
        ssql = ssql & " (((transaction.datecomplete) <= '" & enddate & "'))"
        ssql = ssql & " ORDER BY Job.OrderDate;"
    heres the debug print:

    Code:
    SELECT Customer.Name, job.orderdate, Job.PatientName, Job.[Item Description], Job.jobcode, Job.Order_Status, Job.TrayNumber, Job.JobNumber, Job.JobID, Job.custid, Job.jobcode FROM Customer INNER JOIN Job ON Customer.CustID = Job.CustID WHERE (((Customer.Name) = 'Hughes & McHugh (Airdrie)')) AND  (((Job.Order_Status) = 'Invoice')) AND  (((transaction.datecomplete) => '14/08/03')) AND  (((transaction.datecomplete) <= '14/08/03')) ORDER BY Job.OrderDate;
    im getting a missing operator in expression....


    please help if u can

    thanks

    davie.






    the main culprit was => , >= was accepted...


    thanks guys...
    Last edited by fenster; Aug 14th, 2003 at 09:35 AM.

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