ca1358
asked on
Deleting Criteria
I included a Sample Database.
Problem is the Delete query. When I view it gives the right information.
But when I hit Run it states “Specify the table containing the records you want to delete. Everything I TRIED AS NOT WORKED.
The Records need to delete out table ‘CMTS_Daily_Extract and the MinTime Taken only leaving the Max Time.
This is the criteria :WHERE (([CMTS_Daily_Extract]![Ta kenTime]=[ DupsWithOn lyMINTime] ![TakenTim e]));
SQL View: DELETE CMTS_Daily_Extract.CMTID, CMTS_Daily_Extract.TakenTi me
FROM CMTS_Daily_Extract, DupsWithOnlyMINTime
WHERE (([CMTS_Daily_Extract]![Ta kenTime]=[ DupsWithOn lyMINTime] ![TakenTim e]));
I greatly appreciate any help!
DeleteCriteria.mdb
Problem is the Delete query. When I view it gives the right information.
But when I hit Run it states “Specify the table containing the records you want to delete. Everything I TRIED AS NOT WORKED.
The Records need to delete out table ‘CMTS_Daily_Extract and the MinTime Taken only leaving the Max Time.
This is the criteria :WHERE (([CMTS_Daily_Extract]![Ta
SQL View: DELETE CMTS_Daily_Extract.CMTID, CMTS_Daily_Extract.TakenTi
FROM CMTS_Daily_Extract, DupsWithOnlyMINTime
WHERE (([CMTS_Daily_Extract]![Ta
I greatly appreciate any help!
DeleteCriteria.mdb
ASKER
It did not work . Error "join Expression not supported "ON [CMTS_Daily_Extract]![Take nTime]=[Du psWithOnly MINTime]![ TakenTime] "
Rather than trying to debug the syntax with our eyes, build the query using the QBE.
Add both tables.
Draw the join line.
Change the query type to Delete.
Add both tables.
Draw the join line.
Change the query type to Delete.
ASKER
Including File with query "Delete_QRY
DeleteCriteria.mdb
When Hit Run Error is "Specify the table containing the records you want to delete.
DeleteCriteria.mdb
When Hit Run Error is "Specify the table containing the records you want to delete.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you!!
Try
SQL View: DELETE CMTS_Daily_Extract.*
FROM CMTS_Daily_Extract Inner Join DupsWithOnlyMINTime
ON (([CMTS_Daily_Extract]![Ta
If that doesn't work, it is because of the aggregation in the Dups query. A subselect might work so you can try that. If nothing else works to make the query updateable, then you need to create a temp table to hold the dups and join to that instead of to the query. Most of the time, you should avoid temp tables like the plague. Use them only if you start with a large number of rows and through lots of manipulation end up with a few rows and you need to use the result set more than once OR as in this case if your action query must join to aggregated data and that is making the query non-updateable.