Subject Re: [ib-support] Problem with dates in SP
Author Martijn Tonies
Reading your original post doesn't give me more clues then this.

Please explain more... Questions below. And you should have
started with this right away - then you probably would have had
an answer by now.

-- what kind of value are you passing to P_DELTA (TIMESTAMP?)

P_DELTA TIMESTAMP)
RETURNS (
ID_INTERVENTI NUMERIC (18, 0))
AS
declare variable DELTA_TIME TIMESTAMP;
BEGIN
DELTA_TIME = CAST ('now' AS TIMESTAMP);

-- The aim of this is, what?

DELTA_TIME = DELTA_TIME - :P_DELTA;

-- time minus time doesn't get you a "time value" - it get's a duration.
Therefore, WHAT are you passing, and WHY?

FOR SELECT ID_INTERVENTI FROM INTERVENTI
WHERE ORA_INVIO < :DELTA_TIME AND ((INVIATO IS NULL) or (INVIATO=0))

-- is ORA_INVIO a TIMESTAMP column or a duration (integer?)
If it's a timestamp, what's wrong with passing a certain amount of time,
for example, 10 days to P_DELTA and doing the query like:

WHERE ORA_INVIO < (CURRENT_TIMESTAMP - :P_DELTA)

??

Martijn Tonies
InterBase Workbench - the developer tool for InterBase and Firebird
http://www.interbaseworkbench.com

Upscene Productions
http://www.upscene.com

"This is an object-oriented system.
If we change anything, the users object."


> >Well, this works fine for me:
> >
> >select *
> >from bestelling
> >where leverdatum > current_date - 140
> >
> >Where leverdatum > currentdate - 140 days...
>
> I know this works!
> BUt I need to subtract a Time passed to a stored proc as a parameter!
> Regards
> Marco
>
>
> Best Regards,
> Marco Lauria
> STARMAX s.a.s.
> TEL. +39-091-6880476
> FAX. +39-091-6887202
> MOB. +39-348-3547034
>
> [Non-text portions of this message have been removed]
>
>
>
> To unsubscribe from this group, send an email to:
> ib-support-unsubscribe@egroups.com
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>