Simple Delete Query- Can't Delete records

spudd

New Member
Joined
Jan 18, 2011
Messages
18
I have a simple delete query.

Made up of 2 queries.

Query 1 [Upper and Lower dates] finds the max and min out of set of records [Lower1]

Query 2 contains the data.[Demand]

What I want to do is delete the data that is less than [Demand].[WkYr]

DELETE DISTINCTROW demand.*, demand.WkYr
FROM demand, [Upper and Lower Dates]
WHERE (((demand.WkYr)<[Lower1]));

When I look at the datasheet the data is correct that I want to delete, but the query falls over when I run it. "Could Not Delete from Specified Tables"

I have set the Unique records to YES.

Cheers

Andy
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
I have a simple delete query.

Made up of 2 queries.

Query 1 [Upper and Lower dates] finds the max and min out of set of records [Lower1]

Query 2 contains the data.[Demand]

What I want to do is delete the data that is less than [Demand].[WkYr]

DELETE DISTINCTROW demand.*, demand.WkYr
FROM demand, [Upper and Lower Dates]
WHERE (((demand.WkYr)<[Lower1]));

When I look at the datasheet the data is correct that I want to delete, but the query falls over when I run it. "Could Not Delete from Specified Tables"

I have set the Unique records to YES.

Cheers

Andy


try removing

DISTINCTROW demand.*,
 
Upvote 0
Tried that as a solution, but just keeps asking to Specify the table to delete from.

DELETE demand.WkYr
FROM demand, [Upper and Lower Dates]
WHERE (((demand.WkYr)<[Lower1]));

Above is the new sql.

Cheers

Andy
 
Upvote 0
Open your query in design view
in 2007 where on the ribbon bar you have the greek letter for adding totals (the show/Hide section on the right hand side)

there is a property sheet open this and change the Unique record entry from no to yes
 
Upvote 0

Forum statistics

Threads
1,224,522
Messages
6,179,297
Members
452,903
Latest member
Knuddeluff

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top