Hi all ,
I have the following statement to convert the CURRENT_TIMESTAMP to format as
TUE JULY 25 23:11:13 2008 but I got the empty string. Can you help me why the 
empty string is returned.
Below is sql statement:
select
(case strftime('%w', d) when 0 then 'SUN' when 1 then 'MON’ when 2 then ‘TUE’ 
when 3 then ‘WED’ when 4 then ‘THUR’ when 5 then ‘FRI’ when 6 then ‘SAT’ end)  
|| ‘ ‘ ||
(case strftime('%m', d) when 1 then 'JAN'  when 2 then ‘FEB’ when 3 then ‘MAR’ 
when 4 then ‘APR’ when 5 then ‘MAY’ when 6 then ‘JUN’ when 7 then ‘JUL’  when 8 
then “AUG’ when 9 then ‘SEP’ when 10 then ‘OCT’ when 11 then ‘NOV’  when 12 
then 'DEC' end)
    || ' ' ||
strftime('%d %H:%M:%S %Y', d)
from (select CURRENT_TIMESTAMP as d);
Thanks,
JP



----- Original Message ----
From: Harold Wood & Meyuni Gani <[EMAIL PROTECTED]>
To: General Discussion of SQLite Database <sqlite-users@sqlite.org>
Sent: Friday, July 25, 2008 4:41:59 PM
Subject: Re: [sqlite] Convert the CURRENT_TIMESTAMP

Look at the wiki for date/time functions, specifically strft.

Woody
from his pda

-----Original Message-----
From: Joanne Pham <[EMAIL PROTECTED]>
Sent: Friday, July 25, 2008 4:08 PM
To: General Discussion of SQLite Database <sqlite-users@sqlite.org>; [EMAIL 
PROTECTED]
Subject: [sqlite] Convert the CURRENT_TIMESTAMP

Hi All,
I ran the following sql statement
select CURRENT_TIMESTAMP;
and the output is :
2008-07-25 23:11:13
Is there any easy way or buildin function to convert this format to :
TUE JULY 25 23:11:13 2008
Thanks,
JP



_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users



      
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users



      
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to