Subject RE: [IBO] Hello
Author Claudio Valderrama C.
> -----Original Message-----
> From: Yagi [mailto:yagi@...]
> Sent: Martes 13 de Febrero de 2001 9:53
>
> for IB 5.6
>
> CREATE PROCEDURE (
> date DATE, /*only date part*/
> time DATE /*only time part*/
> )
> AS
> DECLARE VARIABLE date_time DATE; /*this variable ought to hold date and
> time*/
> BEGIN

> date_time = date + time; ----ERROR---- /*well this is not
> supported in IB
> 5.6*/
> /*question is: how to add 'date' and 'time' and get 'date_time' value
> holding this*/

There's no time-only field in IB5.X and earlier releases. So, you probably
are using a default or fixed date in the date part of the timestamp field
you use for time only, right? If you stored your time with a trick like this
1900-1-1 time_portion
so you discard the date portion, to make the sum happen you need to do
time_field - '1990-1-1'
=> this will produce a quantity that's the time field represented as a
fractionary number. Take this result and add it to the date field.

> for IB 6.0
>
> CREATE PROCEDURE (
> date DATE, /*only date part*/
> time TIME /*only time part*/
> )
> AS
> DECLARE VARIABLE date_time TIMESTAMP; /*this variable ought to
> hold date and
> time*/
> BEGIN
> .
> date_time = date + time; /*is this supported in IB 6.0 ?*/
> /*if not, question is: how to add 'date' and 'time' and get 'date_time'
> value holding this in IB 6.0*/

This is legal, but only where date-only and time-only exist. I mean you
should use dialect 3. Try this, for example:
select current_date + current_time
from rdb$database

C.