Syntax Error (Missing Operator)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • AllusiveKitten
    New Member
    • Feb 2007
    • 43

    Syntax Error (Missing Operator)

    Hi

    I have a really simple Syntax Error regarding a date that is really giving me the irrates...... It's one of those things you just keep looking over the error.

    [CODE=vb]Set db = CurrentDb()
    lsql = "SELECT Tbl_EnvelopesRe ceived.Date, Tbl_EnvelopesRe ceived.Envelope sReceived From Tbl_EnvelopesRe ceived WHERE (((Tbl_Envelope sReceived.Date) '" & CDate(Txt_Date) & "'));"
    Set lrs = db.openrecordse t(lsql)
    End Sub[/CODE]

    I have tried everything different possibilty with the date and the error still occurs.

    I would really appreciate some assistance in sorting this one out.

    Thank you so much for your help

    AK
  • Killer42
    Recognized Expert Expert
    • Oct 2006
    • 8429

    #2
    I'd suggest you display and carefully examine the value in lsql. You'll find that you are missing the operator (hence the error message) between the field name and the value, in your WHERE clause.

    In other words, you are saying WHERE FIELD VALUE. It doesn't make any sense - you need to specify what sort of relationship you are expecting between them; equal, not equal, whatever.

    Comment

    Working...