Re: [sqlite] Struggling with datetime("now") > MAX(dtEndDate) query - Please Help

2008-12-04 Thread bondington
Brad, Puneet, Thanks for getting back to me so quickly. I feel like a fool ;-) The error of "misuse of aggregate function MAX()" confused me. I ran the same query in SQL Server, got an error message that I understood and realised instantly that my brain wasn't switched on and that I needed to

Re: [sqlite] Struggling with datetime("now") > MAX(dtEndDate) query - Please Help

2008-12-04 Thread P Kishor
On 12/4/08, Brad Stiles <[EMAIL PROTECTED]> wrote: > > SELECT * > > FROM MyTableWithDates > > WHERE datetime("now") > MAX(dtEndDate) > > > What is it that you are actually trying to do with this query? As > formulated (even if it were syntactically correct, which I don't think > it is), you

Re: [sqlite] Struggling with datetime("now") > MAX(dtEndDate) query - Please Help

2008-12-04 Thread Brad Stiles
> SELECT * > FROM MyTableWithDates > WHERE datetime("now") > MAX(dtEndDate) What is it that you are actually trying to do with this query? As formulated (even if it were syntactically correct, which I don't think it is), you are either going to get every row in the table, or no rows at all.

[sqlite] Struggling with datetime("now") > MAX(dtEndDate) query - Please Help

2008-12-04 Thread bondington
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