I am trying to delete all records from a table that are older than 12 months. The date field is a datetime field. I have the following code:
<CFSET DelDate = DateAdd("yyyy",-1,Now())>
<CFQUERY NAME="DelLogs" DATASOURCE="JobOrder#Sfx#">
DELETE FROM JOLog
WHERE TDate <= <CFQUERYPARAM Value="#DelDate#" CFSQLTYPE="CF_SQL_DATETIME">
When I run the code nothing is deleted. What am I doing wrong?