Subject | Re: Problems selecting on Timestamp. |
---|---|
Author | canacourse |
Post date | 2011-11-09T08:49:02Z |
Thanks Helen,
I assume you meant cast ('6.11.2011 08:35:26' as timestamp);? I have tried that but still no records are returned in Ibexpert or ISQL.
TIA
I assume you meant cast ('6.11.2011 08:35:26' as timestamp);? I have tried that but still no records are returned in Ibexpert or ISQL.
TIA
--- In firebird-support@yahoogroups.com, Helen Borrie <helebor@...> wrote:
>
> At 07:45 AM 9/11/2011, canacourse wrote:
>
>
> >How may I select items older than a certain epoch from a timestamp column? For example I have many records in a column using timestamp as the type and containing records such as:-
> >
> >'5.11.2011 23:34:21'
> >'5.11.2011 08:34:00'
> >'6.11.2011 19:55:45'
> >'7.11.2011 15:23:26'
> >
> >However these queries produce no results even thought I can see records older then I'm looking for in the table
> >
> >select * FROM ENTRIES WHERE ENTRYTIME < '6/11/2011 08:34:26';
> >
> >or
> >
> >select * FROM ENTRIES WHERE ENTRYTIME < '6.11.2011 08:34:26';
> >
> >Firebird 2.6.5 Dialect 3
>
> You need a cast expression or a hint to ensure that the conversion from the literal occurs:
>
> select * FROM ENTRIES WHERE ENTRYTIME < (cast '6/11/2011 08:34:26 as timestamp)';
> or
> select * FROM ENTRIES WHERE ENTRYTIME < timestamp '6/11/2011 08:34:26';
>
> ./hb
>