Re: [sqlite] select where date < 30 days ago

2011-09-23 Thread stefanos sofroniou
> >From: Miklos Koren >To: sqlite-users@sqlite.org >Sent: Friday, September 16, 2011 3:01 PM >Subject: [sqlite] select where date < 30 days ago > >Hi, > >This is probably a basic SQL question, but I could not make it work under >sqlite

Re: [sqlite] select where date < 30 days ago

2011-09-16 Thread Igor Tandetnik
Miklos Koren wrote: > I was finally able to make it work with > > WHERE CAST(time AS int)/100/86400+2440588 < JULIANDAY('now','-30days') It appears your timestamp is in microseconds since 1/1/1970. In this case, it might be a bit more straightforward to write where time < strftime('%s', 'n

Re: [sqlite] select where date < 30 days ago

2011-09-16 Thread Miklos Koren
I was finally able to make it work with WHERE CAST(time AS int)/100/86400+2440588 < JULIANDAY('now','-30days') 2011/9/16 Igor Tandetnik > > Show your data, show the results you get from the statement, and explain > how the observed outcome differs from your expectations. > _

Re: [sqlite] select where date < 30 days ago

2011-09-16 Thread Igor Tandetnik
Miklos Koren wrote: > This is probably a basic SQL question, but I could not make it work under > sqlite. How do I select records for which a datetime column is less than > today - 30 days? I tried > > SELECT * FROM ticket WHERE time < DATETIME('now','-30 days'); > > but it does not give the int

[sqlite] select where date < 30 days ago

2011-09-16 Thread Miklos Koren
Hi, This is probably a basic SQL question, but I could not make it work under sqlite. How do I select records for which a datetime column is less than today - 30 days? I tried SELECT * FROM ticket WHERE time < DATETIME('now','-30 days'); but it does not give the intended results. Thanks, Miklo