delete query not working

cpampas

Registered User.
Local time
Today, 00:24
Joined
Jul 23, 2012
Messages
221
Hi,

I want to run a delete query like this :

Code:
DELETE tblApostasTemp.*, tblDatasJogos.data
FROM tblApostasTemp INNER JOIN tblDatasJogos ON tblApostasTemp.jogo = tblDatasJogos.jogo
WHERE (((tblDatasJogos.data)<Now()));

None of the joining fields are primary keys in each table: tblApostasTemp.jogo , and the field tblDatasJogos.jogo
If I run que query as dataSheet view, all the data that I want to delete, list correctly, but if I run as a delete query , an error pops up "not posible to eliminate from the specified tables".

Any thoughts ?
 
When you look at it in datasheet view, is the query read only?
To change that you must set Unique Records =Yes on the property sheet.
In SQL, that is DELETE DISTINCTROW …..
 
the query is not read only, so I did what you suggested and ...
it works great, thanks a lot !!!
 
Excellent. Access will always give that error if there is any ambiguity about which records should be deleted.
That often the case where you have 2 tables in your delete query design
Recommend using DELETE DISTINCTROW whenever you have more than one table
 

Users who are viewing this thread

Back
Top Bottom