Hi,

I've been using SQL for years in SQL Server but I've only recently started
using Sqlite. I've got to grip with most of the little differences but I
can't for the life of me figure out how to do a query where I compare the
current date with the maximum date of a field in a table. E.g.

SELECT *
FROM MyTableWithDates
WHERE datetime("now") > MAX(dtEndDate)

I keep getting an error of "misuse of aggregate function MAX()"

I've defined dtEndDate as DATE and as TIMESTAMP but its made no difference.
I've also tried changing the line to things like WHERE datetime("now") >
MAX(datetime(dtEndDate)) but that hasn't worked.

Please help because this driving me mad!

Cheers
-- 
View this message in context: 
http://www.nabble.com/Struggling-with-datetime%28%22now%22%29-%3E-MAX%28dtEndDate%29-query---Please-Help-tp20837020p20837020.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

Reply via email to