select before a given date no working

p0welly

Registered User.
Local time
Today, 00:25
Joined
Aug 26, 2004
Messages
38
Code:
sql = sql & " WHERE (((tblAccountBalance.DateLastPayment)  < #" & reminderdate & "#))"

Im trying to select all the entrys in a table where the date of the last payment is before a variable 'reminderdate' this works fine if both dates are in the same month ie, DateLastPayment = 26/11/05 and reminder date = 30/11/05, but if the DatelastPayment is 26/11/05 and the reminder date is 01/12/05 then nothing is found.

What am I doing wrong?
 
Thanks that makes sense, ill give that a try
 
You're welcome. Good luck with the rest of your project.
 
Nope that doesnt make any difference, any other suggestions?
 
Are you certain the DateLastPayment field is a date field? Are you just getting an ascii compare (text)?
 
got it, it was the date format, I found that by converting the reminderdate to the american format before passing it to the sql statement that I got the results I was looking for.

Thanks
 
Glad to hear it. Good luck with the rest of your project.
 

Users who are viewing this thread

Back
Top Bottom