[sqlite] help with a query using between with a select staement

2011-06-19 Thread looki

Hi, i have a select stamement which holds two dates, something like:

2011-12-31 09:002011-12-30 21:00
2011-12-31 18:002011-12-31 06:00
...

let me call this t.

and a table 'foods' which also holds a 'time' column and i now want to know
all entries in foods which time is between one of the times in t.

my approach was:

select time, datetime(time, '-4 hours') from symptoms as t; 
select id from food where time between any t;

but this gives me an error.

Thanks for your help!
Tobias

-- 
View this message in context: 
http://old.nabble.com/help-with-a-query-using-between-with-a-select-staement-tp31878758p31878758.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] need help with a query using datetime

2011-06-17 Thread looki

Hi,
i have a table which holds dates like
'2011-12-31 09:00' and i now want to write a query which gives me 2 columns.

First column holds the givin datetime from my table and the second column
should show the datetime from first row but 12 hours before. for example:

'2011-12-31 09:00' '2011-12-30 21:00'
'2011-12-31 12:15' '2011-12-30 00:15'
...

looks simple but datetime was not sufficient for this in my research. 

Very thanks for your help.

Greetz looki



-- 
View this message in context: 
http://old.nabble.com/need-help-with-a-query-using-datetime-tp31868064p31868064.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