Date Related Problem

atisz

Registered User.
Local time
Today, 09:10
Joined
Apr 5, 2005
Messages
96
I have a date related problem. I have an IF statement, that verifyes if a certain date entered in a table is <=Now(). The problem is, that it's vorking great just for curent year, curent month. For example: today is 31.05.2005 and if the value in my table is 13.06.2005 than for the <=Now() testing, it's telling me that 13.06.2005<31.05.2005. Why? Please help!!!!!!!!!!!!

Thanks,
Attila
 
Might be a format problem. Try something like this...

Format("13/06/2005","dd/mm/yyyy") < Format("31/05/2005","dd/mm/yyyy")

The Now() grabs the date and time but the Date() function is just the "date". I have had problems in the past when comparing dates and using the Format() function resolved my issues. Sometimes you have to enclose the date value with #13/06/2005# in calculations.
 
And just in case you are using the dots to split a date - these aren't recognised. It's either hyphens or slashes.
 
My mistake

I had no access to the internet for a longer time so i'm verifying my posts now :) The problem was all mine,and I realised it in a few minutes after puting my post. In hurry I had put a date mask to my field but I had forgot to set it's data type to date! This way each time I entered a date everything was looking great, but in reality...it wasn't.

Attila
 

Users who are viewing this thread

Back
Top Bottom