I'm storing a date in a text field. I want to insert it into a date field.
What is the proper syntaxt?
By "storing a date in a text field", do you mean you're storing the string
of the date, for example, the string "3/18/2007" for March 18, 2007? If yes,
you can use the CDate function to convert the string to a real date value.
Is the date field in the same table, or in a different table? If it's in the
same table, this generic update query would work:
UPDATE YourTableName
SET YourDateField = CDate(YourTextField);

Signature
Ken Snell
<MS ACCESS MVP>
> I'm storing a date in a text field. I want to insert it into a date
> field.
> What is the proper syntaxt?
Justin - 19 Mar 2007 05:15 GMT
Thanks for the reply. The data is stored as "03/18/07". I was using the
CDate() function, but it wasn't working. I realized this was due to null
value fields. I'm using the expersion
IIF(IsDate([myfield]),CDate([myfield]),Null) and it works. Thanks.
> By "storing a date in a text field", do you mean you're storing the string
> of the date, for example, the string "3/18/2007" for March 18, 2007? If yes,
[quoted text clipped - 9 lines]
> > field.
> > What is the proper syntaxt?