Subject Re: [firebird-support] Current date via database query
Author Helen Borrie
At 04:15 PM 4/11/2003 +0200, you wrote:
>Hi
>
>How can I get the current date via a database query?
>
>In a Sybase database it would be >>> select 'today' = getDate() <<< and in
>a SAP database it would be >>> select {fn NOW()} from DumyTable <<<
>
>What is the equivalent in Firebird?

Several.

select current_date as whatever_you_like from rdb$database (date only)
select current_timestamp as whatever_you_like from rdb$database (date and
time)
select cast('today' as date) as whatever_you_like from rdb$database (date
only)
select cast ('now' as timestamp) as whatever_you_like from rdb$database
(date and time)
also
select cast('yesterday' as date) ....
select cast('tomorrow' as date) ...

heLen