Convert Text field to Date field within existing database
On Sun, 21 Dec 2008 13:52:09 -0800 (PST), fallowfz
wrote:
John, Ken - thanks for the help. And I should have clarified, all I
needed from the original field was the date and not the time.
I used the CDate(Format...) in a query and it worked sucessfully! I
had tried Format(CDate...) before with no luck.
I then tried to use the same in an update query, but all I saw was an
empty column. Would there be any reason this function would not work
as an update? Below is the SQL for the update query...
UPDATE MyTable SET MyTable.NewDateField = CDate(Format(Left
([TextField],9),"@@ @@@ @@@@"));
I set the formatting of the NewDateField to "GeneralDate"
I want to update the existing table with the NewDateField so I can
create totals by month, running totals by month, etc. Is there
another way to accomplish this...creating a query using the CDate
(Format...) query and the main table? (never done that before)
Thanks,
-Zack
If you just open the Update query as a datasheet, you'll see the value before
the query is run (blank, in this case). You need to actually execute the query
by clicking the ! icon, and then look in the table directly, or open a form
based on the table.
--
John W. Vinson [MVP]
|