This content has been marked as final. Show 3 replies
Remember that cfquery is putting a string together to send to the database so DATEDIFF(d,InDate,Now()) is wrong it should be DATEDIFF(d,InDate,#Now()#). However, depending on what db you are using I would recommend that you use the internal time on the database so on SQL Server you would use DATEDIFF(d,InDate,getDate())
hi yes i tried that already but i get this error
Syntax error or access violation: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'getDate()) >= 28' at line 3
Well it turns out in MySQL that it is Now() to get the current date, so what you wrote originally would have worked if you had used the correct syntax for dateDiff().
Check this for all the date time functions:-
Here what is what you need:-
DATEDIFF(Now(),InDate) >= 28