Results 1 to 3 of 3
  1. #1
    Join Date
    May 2002
    Posts
    395

    Unanswered: syntax error in query statement

    I have a syntax error in my query statement

    Doesn't work
    "syntax error in query expression (((tblRGAmo.Date)=6/1/1999;'"
    sqlState = sqlState & "tblRGAmo.[Other %] FROM tblRGAmo WHERE (((tblRGAmo.Date) = " & sdate & "));"

    works
    sqlState = sqlState & "tblRGAmo.[Other %] FROM tblRGAmo WHERE (((tblRGAmo.Date) > #6/1/1999#));"

    sdate has a "Date" type and pass as an argument from a called function. I tried concatenate w/ " + sdate + " and I received a "type mismatch" message.

    Any ideas?

    Thanks!!

  2. #2
    Join Date
    Nov 2002
    Location
    Ohio
    Posts
    90
    Try putting the Pound signs in the query around the date field.

    sqlState = sqlState & "tblRGAmo.[Other %] FROM tblRGAmo WHERE (((tblRGAmo.Date) = #" & sdate & "#));"
    Bruce Baasch

  3. #3
    Join Date
    May 2002
    Posts
    395
    Originally posted by Bruce A. Baasch
    Try putting the Pound signs in the query around the date field.

    sqlState = sqlState & "tblRGAmo.[Other %] FROM tblRGAmo WHERE (((tblRGAmo.Date) = #" & sdate & "#));"
    Thank you! Thank you!
    I thought about the pound sign but I just could it right.
    THANK YOU!

Posting Permissions

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