troubleshooting Question

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

Avatar of g118481
g118481 asked on
Web Servers
1 Comment1 Solution146 ViewsLast Modified:

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

<cfloop query="update">
<cffile action="DELETE" file="#uploadedtopath#">

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 1 Comment.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 1 Comment.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros