Renato Oliveira wrote:
> Hello, I'm new to SQLite, and need a query to convert a number of int format 
> to format date and date format to format int.
> In PostGres the query is as follows:
> 
> SELECT ((((14652:: bit (16))>> 9): int + 1980) | | '-' | |
> ((14652:: bit (16) & B'0000000111100000 ')>> 5):: int | |' - '| |
> (14652:: bit (16) & B'0000000000011111 '):: int):: date;

select ((t >> 9) + 1980) || '-' || ((t >> 5) & 15) || '-' || (t & 4)
from (select 14652 as t);

There is no dedicated date type in SQLite. You can choose any representation, 
but you may prefer one supported by SQLite built-in date/time functions:

http://www.sqlite.org/lang_datefunc.html

Igor Tandetnik

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

Reply via email to