Subject | Re: [firebird-support] date functions |
---|---|
Author | Ivan Prenosil |
Post date | 2004-01-29T12:39:35Z |
> The following query does not return data as expected...
>
> select cast('TODAY' as TimeStamp) today, /* fine */
> cast(cast(date_out as date) as TimeStamp) date_out, /* Fine */
> cast(cast(date_out as timeStamp)as date) /* expected to display only
> date, but still has the hours and minutes with */
> Hmm, would the sql dialect make a diffs??Yes. In dialect-3 there are three datatypes: DATE, TIME, TIMESTAMP,
whereas in dialect-1 (or IB4, IB5) there is only single type containing
both date and time (i.e. timestamp), that was unfortunately called DATE
in those old InterBase versions. To be "compatible" with both
old and new applications, dialect-1 maps both DATE and TIMESTAMP
keywords into the same datatype.
There is not any DATE-only datatype in dialect-1.
You can have your application ignore Time part of this Date/Timestamp value.
Ivan
http://www.volny.cz/iprenosil/interbase/