CONVERSION DATE PROBLEM

L

Lucio

I have a txt file where the field is of the format 'dd-mmm-yy'. For example
04-MAY-04

When I import the file, it automatically detects that the field should be
date/time.

If I leave it as date/time, it fails to convert it.

I want to load the date and then I want to select only those records that
fall between '01-jan-06' and '01'jul-06'.

I have been using SQL.
 
J

John Spencer

Import it as a text string and then use an expression in the query to
convert the value from a string to a date.

The expression would be
IIF(IsDate([TheField]),CDate([TheField]), Null)

Then you should be able to apply criteria against that expression.

--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..
 
Top