Subject | Re: [firebird-support] Why a certain expression in 'where' throws an error? |
---|---|
Author | Paul Vinkenoog |
Post date | 2010-12-22T16:35:32Z |
Hi kokok,
Anyway: you can't cast dates to integers. And you don't need a cast to add a float to a date. However, it will return a date, without time part.
Try:
where OrderDate + round(LfAvgDates) between '2009/1/1' and '2010/1/1'
HTH,
Paul Vinkenoog
> SELECT * FROM OrdersNext time, please include the error message!
> 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?
Anyway: you can't cast dates to integers. And you don't need a cast to add a float to a date. However, it will return a date, without time part.
Try:
where OrderDate + round(LfAvgDates) between '2009/1/1' and '2010/1/1'
HTH,
Paul Vinkenoog