Re: [firebird-support] There is a way to format datetime directly in SQL ?

2012-05-17 Thread Michael Ludwig
Matthias Hanft schrieb am 17.05.2012 um 12:14 (+0200): Huan Ruan wrote: select extract(year from current_date) || '-' || lpad(extract(month from current_date), 2, '0') || '-' || extract(day from current_date) from rdb$database Is this an atomic operation? It is: It

Re: [firebird-support] There is a way to format datetime directly in SQL ?

2012-05-17 Thread Milan Babuskov
hamacker wrote: There is a way to format a datetime inside a query ? You can find some interesting ideas here, ranging from UDFs to SUBSTRING tricks: http://www.firebirdfaq.org/faq314 HTH -- Milan Babuskov == The easiest way to import XML, CSV and textual

Re: [firebird-support] There is a way to format datetime directly in SQL ?

2012-05-16 Thread Huan Ruan
Hi Hi everybody, There is a way to format a datetime inside a query ? When use a CAST function to convert datetime to string : CAST(SUBSTRING(CAST(a.LAST_UPDATE as varchar(30)) FROM 1 FOR 10) - Get only date, without a time. From this cast, returning date in format -MM-DD, but I

Re: [firebird-support] There is a way to format datetime directly in SQL ?

2012-05-16 Thread hamacker
Thanks, thats better than substring. 2012/5/16 Huan Ruan leohuanr...@gmail.com: Hi  Hi everybody, There is a way to format a datetime inside a query ? When use a CAST function to convert datetime to string : CAST(SUBSTRING(CAST(a.LAST_UPDATE as varchar(30)) FROM 1 FOR 10) - Get only

[firebird-support] There is a way to format datetime directly in SQL ?

2012-05-15 Thread hamacker
Hi everybody, There is a way to format a datetime inside a query ? When use a CAST function to convert datetime to string : CAST(SUBSTRING(CAST(a.LAST_UPDATE as varchar(30)) FROM 1 FOR 10) - Get only date, without a time. From this cast, returning date in format -MM-DD, but I would like to