Subject Re: [firebird-support] How to combine date and time?
Author Hans
This seems to work

CREATE TABLE TEST (
MYDATE DATE
, MYTIME TIME
)

Populate one row with

MYDATE = '12/3/2008'
MYTIME = '12:56:00 PM'

and

SELECT CAST(MYDATE+MYTIME AS TIMESTAMP) MYDATETIME FROM TEST

returns

MYDATETIME = '12/3/2008 12:56:00 PM'


----- Original Message -----
From: "Harriv" <harriv@...>
To: <firebird-support@yahoogroups.com>
Sent: Sunday, February 21, 2010 1:41 PM
Subject: Re: [firebird-support] How to combine date and time?


> On Fri, Feb 19, 2010 at 4:01 AM, Ivan Prenosil
> <Ivan.Prenosil@...>wrote:
>
>>
>>
>> > I've legacy database where timestamp is stored in two separate
>> > 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
>
>
>>
>>
>
>
> [Non-text portions of this message have been removed]
>
>
>
> ------------------------------------
>
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>
> Visit http://www.firebirdsql.org and click the Resources item
> on the main (top) menu. Try Knowledgebase and FAQ links !
>
> Also search the knowledgebases at http://www.ibphoenix.com
>
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> Yahoo! Groups Links
>
>
>