Subject | Re: [firebird-support] How to combine date and time? |
---|---|
Author | Harriv |
Post date | 2010-02-22T10:06:19Z |
2010/2/22 Ivan Prenosil <Ivan.Prenosil@...>:
A_TIME is declared as a "Time".
But as Hans points out, casting works, this is ok:
SELECT * FROM MY_TABLE WHERE cast(A_DATE + A_TIME as timestamp) >
'2010-2-18 12:00' "
>>> > I've legacy database where timestamp is stored in two separateA_DATE is declared as a "Date"
>>> > fields, date and time. How I can combine the values so that I can use
>>> > timestamp as a criteria?
>>> >
>>> > Something like this: "SELECT * FROM MY_TABLE WHERE (A_DATE + A_TIME) >
>>> '2010-2-18 12:00' "
>>>
>>> The above is correct statement :) Do you have some problems with it ?
>>>
>>
>> Isql gives me following error message:
>>
>> Statement failed, SQLCODE = -902
>> Dynamic SQL Error
>> -expression evaluation not supported
>
> Is A_DATE really declared as DATE, or TIMESTAMP ?
A_TIME is declared as a "Time".
But as Hans points out, casting works, this is ok:
SELECT * FROM MY_TABLE WHERE cast(A_DATE + A_TIME as timestamp) >
'2010-2-18 12:00' "