Date conversion error

micki_free

New member
Local time
Yesterday, 19:33
Joined
May 1, 2008
Messages
8
I am getting an error with a query. specifically when i try to do a date conversion. Access will throw up an exception when a field contains a null value or a value that can not be converted to a date.

I need a way to bypass the conversion of null or other values (the text value of these fields is 'never'). is this possible?

Code:
SELECT COUNT(*)
FROM sites_users_and_role
WHERE sites_users_and_role.Service_Type = 'Occasional' AND CDate(Format(CDate([sites_users_and_role.Last_login]), "mm/dd/yyyy")) < #12/01/2008#;
 
change the statement to an IIF():


IIF(my field IS NULL, "never", cdate(my expression))
 

Users who are viewing this thread

Back
Top Bottom