Subject Re: [firebird-support] Grabbing only date portion of Timestamp?
Author Dan Wilson
On 7/6/2004 at 1:47 PM Joe Martinez wrote:

> 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?
>

update table2 set MyDate = (select cast(SomeDate as Date) from Table1 where Table1.KeyField = Table2.KeyField )

HTH,

Dan.