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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top