Re: [sqlite] DateTime comparison with custom format

2009-08-21 Thread t-master



Igor Tandetnik wrote:
> 
> t-master <t-zimmerm...@onlinehome.de> wrote:
>> I have string in a table representing a DateTime.
>> The format is 21.08.2009 00:25:00
> 
> I recommend you change the format. Yours is custom-designed to make your 
> life miserable.
> 
>> And I would like to compare it to "now"
> 
> select case when
> substr(T, 7, 4)||'-'||substr(T, 4, 2)||'-'||substr(T,1,2)||substr(T, 
> 11) > datetime('now')
> then 'future' else 'past' end
> from (select '21.08.2009 00:25:00' as T);
> 
> Igor Tandetnik 
> 
> 
> 
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> 
> 

Hi

the problem is, this db is created by another program and I don't have the
access to change the format (btw it's the standard datetime format in
germany, not custom-designed :-P)

-- 
View this message in context: 
http://www.nabble.com/DateTime-comparison-with-custom-format-tp25085040p25088287.html
Sent from the SQLite mailing list archive at Nabble.com.

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


[sqlite] DateTime comparison with custom format

2009-08-21 Thread t-master

Hi
I have string in a table representing a DateTime.
The format is 21.08.2009 00:25:00
And I would like to compare it to "now"
How can I do this?
-- 
View this message in context: 
http://www.nabble.com/DateTime-comparison-with-custom-format-tp25085040p25085040.html
Sent from the SQLite mailing list archive at Nabble.com.

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