Can a delete query delete only ONE record? (1 Viewer)

M

mrmazahei

Guest
Hello all,

Thank you very much in taking interst to answer my question.

It seems to me like a simple solution but no matter what I did I could
not solve it. Heres my problem...

Lets say you have a simple table of 100 records, 10 of those records
contain a field with the letters "ZZZ".

Ok now I make a delete query which selects any record with the letters
"ZZZ"
obviously the query selects ten records,

Ok now I want to run the query BUT I want it to delete only one of
those records NOT all ten records. how do I do that?

Thank You again for your kind help.

Sincerely Yours.

Reza Mazaheri.
 

llkhoutx

Registered User.
Local time
Yesterday, 22:34
Joined
Feb 26, 2001
Messages
4,018
How do you know which one to delete? Develop a delete query with that criteria.
 
M

mrmazahei

Guest
Thank you for replying,

Actually all the 10 records are the same so it dose not matter which one it deletes just as long as it ONLY deletes ONE record every time the query is run.

Thanks again.
Reza
 
M

mrmazahei

Guest
Thanks so much guys,

Delete querys do not except topvalues, so I cant try that.

I put the "zzz" in the criteria box under the WHERE, then it returns all ten records, but now how do I delete only one of them (anyone of them)

I even put an autonumber field in the table, but when I used the DMAX in the criteria, it retunes the last autonumber of the entire table, not just the "zzz"

Thanks again.
Reza.
 

Fizzio

Chief Torturer
Local time
Today, 04:34
Joined
Feb 21, 2002
Messages
1,885
Set up a Select Query with the required criteria and set the top values to one. Then Run the Delete Query on this query.

HTH
 

David R

I know a few things...
Local time
Yesterday, 22:34
Joined
Oct 23, 2001
Messages
2,633
The logic of what you are doing escapes me.

Why do you have 10 records of the exact same thing, and why do you need to delete one and only one when a query is run?

Can you give a more concrete example? Perhaps there is an alternate structure someone can suggest.
 

Users who are viewing this thread

Top Bottom