X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
   Reply to this topicStart new topic
> Deleting Records By Criteria, Access 2010    
post Nov 28 2017, 11:10 AM

Posts: 100
Joined: 23-March 17

I want to delete the records containing the ZHU entry from the table.
but only if the number occurs more than once

removal scheme

Identyfikator numer tekst
1 3698 ZHU Delete
2 3698 jakiś tekst
3 3698 jakiś tekst
4 3698 ZHU Delete

5 2589 ZHU we do not remove

6 888 ZHU Delete
7 888 jakiś tekst
8 888 jakiś tekst
9 888 jakiś tekst

10 999 ZHU we do not remove
Attached File(s)
Attached File  Delete_record.zip ( 23.85K )Number of downloads: 7
Go to the top of the page
post Nov 28 2017, 11:24 AM

UtterAccess Editor
Posts: 18,223
Joined: 29-March 05
From: Wisconsin


Try this:

WHERE DCount("*","ttt","numer=" & [numer])>1 AND tekst="ZHU";

Hope this helps,


(;,;) Li'l Cthulu says: Please talk about what you're trying to do, as well as how you're doing it.
Changing your real table name to "Table1" and your real form name to "Form1" in your posts makes it more difficult to understand what's going on, not easier.
Guidelines for Posting Questions
Go to the top of the page
post Nov 28 2017, 11:28 AM

UtterAccess VIP
Posts: 8,158
Joined: 25-October 10
From: Gulf South USA

Hi: Try this ...

DELETE Identyfikator
FROM ttt
WHERE tekst="ZHU" AND DCount("*","[ttt]","[numer]=" & [numer])>1;



AH ... Looks like Dennis beat me to it. Shouldn't have taken that phone call in the middle of testing this!

"Each problem that I solved became a rule, which served afterwards to solve other problems."
"You just keep pushing. You just keep pushing. I made every mistake that could be made. But I just kept pushing."

Rene Descartes 1596-1650 (Mathematician and Philosopher)
Go to the top of the page
post Nov 28 2017, 12:45 PM

Posts: 100
Joined: 23-March 17

Oh no smile.gif but it works great
Thank you very much for your kindness, I will use both ways of your doctor9 and Mr. RJD
thank you very much
Go to the top of the page

Custom Search
RSSSearch   Top   Lo-Fi    25th March 2018 - 12:36 AM