Subject Re: Grabbing only date portion of Timestamp?
Author Alexander V.Nevsky
--- In firebird-support@yahoogroups.com, Joe Martinez <joe@j...> wrote:
>
> >What is the dialect of the database? If it's dialect 1, then you'll
> >need a UDF to extract the date portion. Because under dialect 1, the
> >datatype DATE is the equivalent of TIMESTAMP in dialect 3, and that
> >there's no equivalent for dialect 3's DATE and TIME datatypes.
>
> Yes, it is dialect 1. Sigh.

Joe, if you'll be satisfied with zeroed time fraction, use

update table2 set MyDate =
(Select
Cast(Extract (Year From Table1.SomeDate) ||'-'|| Extract (Month From
Table1.SomeDate) ||'-'|| Extract (Day From Table1.SomeDate) As
TimeStamp) from Table1
where Table1.KeyField = Table2.KeyField )

Best regards,
Alexander