1 person found this helpful
where #DateFormat(DateAdd('d', 7, date),'yyyy-mm-dd')# > #DateFormat(now(), 'yyyy-mm-dd')#
As Coldfusion tells you, rightly so, it knows no variable called 'date'. You are in a query and, apparently, 'date' is a column name. So use SQL functions instead of Coldfusion functions.
In MySQL, the corresponding where-clause is:
WHERE DATE_ADD(date, INTERVAL 7 DAY) > CURDATE()
In SQL Server, the corresponding where-clause is:
WHERE DATEADD(day,7,date) > GETDATE()
Afterthought: I would rename the column 'date', as this is a reserved word in some Database Management Systems
Since there are 20 different classes with different dates, am I better using a cfif with mySQl statement in a loop?
You may have 20 date values, but you have just one date column. You need just the column name as the argument in the database functions.
That is correct, one date column. I will give it a try. Thanks.
that is the answer BKBK, as always, thank you.