Link to home
Start Free TrialLog in
Avatar of g118481
g118481

asked on

How can I write a query to scan a table and perform mass deletes?

Hi,

I have an Access table that I want to delete records that are older than 90 days.

Also, I want to delete the documents(files) that are associated with these records at the same time.

Here is the simple code I'm trying to get to work, but I am getting the error "The QUERY attribute of the tag does not specify the name of an available query"...

Any ideas on how I can fix this?

/*****************************************************/
<cfquery datasource="cmdoc" name="update">
delete from cm
where individual_folder='yes' and datepublished < #createodbcdate(now())# - 90
</cfquery>

<cfloop query="update">
<cffile action="DELETE" file="#uploadedtopath#">
</cfloop>
/*****************************************************/
ASKER CERTIFIED SOLUTION
Avatar of danrosenthal
danrosenthal

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial