Subject Re: Is this a firebird bug ?
Author Alexander V.Nevsky
--- In ib-support@yahoogroups.com, "Carlos H. Cantu" <warmbooter@w...>
wrote:
> One more info :
>
> If I replace
>
> where (p.brinco = :Brinco) and ((p.data - :dNasc) <= 20)
>
> with the equivalent
>
> where (p.brinco = :Brinco) and (p.data <= (:dNasc+20))
>
> it does not raise the error, so I think this is really a FB bug.

Carlos, can't surely say is it bug or feature (you know, I use
dialect 1 ;)), but in dialect 3 you can't perform arithmetic
operations when both operands are dates. In dialect 1 you can, result
is interpreted as double, but in 3, where Date is based on integer -
not. Sense of result of such operation is time interval, not a date,
and in FB there is not such datatype (Oracle have this). Why was made
decision not to interprete this result as integer, I don't know. BTW,
even in dialect 1 you can't make Date1+Date2 (and that is
understandable - what is the sence of result?), only Date1-Date2. So,
if you'll proceed discussion in firebird-devel, you can ask directly
why they don't want to interprete time interval accordingly basic
datatype.

Best regards, Alexander V.Nevsky.