Subject [Ticket #233] [firebird-support] Re: Problems selecting on Timestamp.
Author Desarrollo
This is a notification from the Help Desk.




On Mar 07, 2014 @ 03:29 pm, kjell.rilbe@... wrote:
Den 2011-11-09 09:49 skrev canacourse såhär:
>
> 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.
>
Make sure your string literal is interpreted the way you think. If only
people would come to their senses and adopt the ISO 8601 standard. *sigh*

For example, does '6.11.2011 08:35:26' result in Nov 6 or June 11?

Kjell


[Non-text portions of this message have been removed]



------------------------------------

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Visit http://www.firebirdsql.org and click the Resources item
on the main (top) menu. Try Knowledgebase and FAQ links !

Also search the knowledgebases at http://www.ibphoenix.com

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Yahoo! Groups Links




==Ticket History==

On Mar 07, 2014 @ 03:29 pm, canacourse@... wrote:
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



--- 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
>

------
This is an automated response. Your issue has been noted. We'll be in touch soon.



Please reply to this email or visit the URL below with any additional details.

http://DANTOIN:9675/portal/view-help-request/233




[Non-text portions of this message have been removed]