Where

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello all I have this and its not excluding the crdmax from my where clause

CrdMax = DMax("Credit", "Post to GP")
Set rs = db.OpenRecordset("SELECT Credit FROM [Post to GP] Where ([Post to
GP].Credit <> 0) and ([Post to GP].Credit <> " & CrdMax & ")")

any thoughts on what I am doing wrong
 
I changed your sql statment slightly to
"SELECT Credit FROM [Post to GP] Where Credit <> 0 and Credit <> " & CrdMax
and it ran fine. Try cleaning up the SQL statement a little, deleting
unnecessary parentheses and [] table references.
 
Back
Top