Jean-Denis Muys wrote:
> On 11/24/09 14:08 , "Igor Tandetnik" <itandet...@mvps.org> wrote:
> 
>> 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);
>> 
> 
> Shouldn't the last mask be 31 instead of 4?

Yes, it should. I don't know what I was thinking.

Igor Tandetnik

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

Reply via email to