Subject | Grabbing only date portion of Timestamp? |
---|---|
Author | Joe Martinez |
Post date | 2004-07-06T20:47:23Z |
I have two tables with fields of type Timestamp. Table1 has a date/time in
there. Table 2 has the field blank. I want to do a SQL command that will
take all the dates from the date field ofTable1 and copy them over to
table2, but ONLY the date portion.
So, something like:
update table2 set MyDate = (select SomeDate from Table1 where
Table1.KeyField = Table2.KeyField)
Except that this pulls over both the time and date. I want the time
portion to get chopped off when stored in Table2.
How can I modify that query to make that happen?
-Joe
there. Table 2 has the field blank. I want to do a SQL command that will
take all the dates from the date field ofTable1 and copy them over to
table2, but ONLY the date portion.
So, something like:
update table2 set MyDate = (select SomeDate from Table1 where
Table1.KeyField = Table2.KeyField)
Except that this pulls over both the time and date. I want the time
portion to get chopped off when stored in Table2.
How can I modify that query to make that happen?
-Joe