Subject | Re: [IBO] Date arithmetics |
---|---|
Author | Luiz |
Post date | 2003-04-02T20:18:01Z |
Svein,
You could try:
SELECT AColumn
FROM ATable
WHERE Date2 - Date1<= :OneInteger AND Date2-Date1>= :AnotherInteger
Luiz.
You could try:
SELECT AColumn
FROM ATable
WHERE Date2 - Date1<= :OneInteger AND Date2-Date1>= :AnotherInteger
Luiz.
----- Original Message -----
From: "Svein Erling Tysvaer" <svein.erling.tysvaer@...>
To: <IBObjects@yahoogroups.com>
Sent: Wednesday, April 02, 2003 8:54 AM
Subject: Re: [IBO] Date arithmetics
> At 20:34 02.04.2003 +1000, you wrote:
> >At 12:40 PM 2/04/2003 +0200, you wrote:
> > >I worked around this using a stored procedure. Still, I do wonder why
> > >
> > >SELECT AColumn
> > >FROM ATable
> > >WHERE Date1 BETWEEN Date2 - :OneInteger AND Date2 - :AnotherInteger
> > >
> > >insists on OneInteger being a TimeStamp when used in a normal
TIB_Cursor or
> > >IB_SQL?
> >
> >Bracketing?
> >What does this do ---
> >
> >SELECT AColumn
> >FROM ATable
> >WHERE
> >(Date1 BETWEEN (Date2 - :OneInteger) AND (Date2 - :AnotherInteger))
>
> IB_SQL still reports that OneInteger is supposed to be a TimeStamp,
whereas
> AnotherInteger is a Numeric(18,9).
>
> Since it worked using a SP, it is no big deal, but it still puzzles me.
>
> I also tried changing to adding a number of days rather than subtracting,
> and then I got a dynamic SQL error 335544569: 'expression evaluation not
> supported' (which is quite reasonable if believing OneInteger to be a
> TimeStamp).
>