Subject Re: How to select records more than one hour old
Author Dimitrios Chr. Ioannidis
--- In firebird-support@yahoogroups.com, "Michael L. Horne"
<guardian@p...> wrote:
> Hello,
>
> I need a select that can return all records
> more than one hour old.
>
> Firebird 1.5 dilect 1
>
> I tried
> select * from file
> where fDate < cast('now' - (1/24) as date)
> but I get "Overflow occurred during data type conversion from
string "now""

if fDate is timestamp try something like

select * from file
where fDate < ( current_timestamp - (Cast('1' as numeric(18,9)) /
24) )

I use that syntax cause i want to use parameters sometimes,
something like

select * from file
where fDate < ( current_timestamp - (Cast(:Hour as numeric(18,9)) /
24) )

Regards,

--
Dimitrios Chr. Ioannidis