Querying a text field to return as date/time

G

Guest

I have a table that contains fields with date and time stamps but the format
of these fields are text. Does anyone know how I can leave these as text but
create a query that can read them as date/time value?

Thanks!
 
J

John Spencer

You can try converting them in the query with a calculation

IIF(IsDate([YourField]),CDate([YourField]),Null) as RealDateField

If you are sure that YourField always contains a valid string then you can
drop the test and use
CDate([YourField])
 
G

Guest

In the design view change the field from the current name i.e. YourDateField
to be like this SomethingDate: CVDate([YourDateField]) and that should do
it.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top