Subject Re: [firebird-support] Date extract from TIMESTAMP
Author Bogusław Brandys
agung wibowo wrote:
> WHY you don't use DATE data type directly?? in firebird and interbase 6.0, there are 3 datetime data type; DATE (manage date data only); TIME manage time only and TIMESTAMP manage both date and time.
> i don't know what is your goals here..
> but if you still need this, you can make some trigger to do that...
> sory for my bad english
> best regards
> Wayne Forrest <wayne@...> wrote:
> How can I only get DATE portion of a TIMESTAMP;
>
> I have a field that is of type TIMESTAMP I would like to have a computed
> field that stores ony the "date" portion and not the TIME portion.
>

This is little more difficult question ;-)

Is I have TIMESTAMP field indexed (as this is FK in this table ) will
Firebird use this index to calculate

select * from sometable where cast(timestamp_field as DATE) beetwen ? and ?

(where ? are parameters)


Regards
Boguslaw Brandys