Run Text Data Type Against Date

crhodus

Registered User.
Local time
Today, 15:22
Joined
Mar 16, 2001
Messages
257
I need to run a query for a particular time frame. The only problem is that the CurrentDate field in the table has its data type set to Text.

I thought I could do something like this but it didn't work:
WHERE cdate(myTable.CurrentDate) >= #01/01/2004#

Isn't there a way to "convert" this field so that it behaves as a date field when the query runs?

Thanks,
crhodus
 
Cdate should work, IF the text field is a valid date format. For instance, "Oct 13 2005" is a valid date field, but "Octo 13, 2005" is not.

The best way to check is to create a query like so:

SELECT IsDate(myTable.CurrentDate) AS DateCheck
FROM myTable

If DateCheck returns false, then CurrentDate is not a valid date field for that record.
 

Users who are viewing this thread

Back
Top Bottom