Subject Re: [firebird-support] Why a certain expression in 'where' throws an error?
Author Ann W. Harrison
On 12/22/2010 11:20 AM, kokok_kokok wrote:
> I have simple query:
>
>
> SELECT * FROM Orders
> WHERE
> CAST(OrderDate + CAST((LfAvgDays+0.5) AS INTEGER) AS DATE) BETWEEN '2009/1/1' AND '2010/1/1'
>
>
> OrderDate is date type. LfAvgDays is float type. Why do I get error when I execute it?
>
> I have tried also:
>
> SELECT * FROM Orders
> WHERE
> CAST(OrderDate + CAST((LfAvgDays+0.5) AS INTEGER) AS DATE) BETWEEN
> CAST('2009/1/1' AS DATE) AND CAST('2010/1/1' AS DATE)
>

Often it helps to indicate the version of Firebid, sometimes the
environment, but always, Always, ALWAYS include the error message!

Cheers,

Ann