Text Format to Date

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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);
 
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.
 
Back
Top