Where

B

bam

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
 
M

mray29

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.
 
Top