Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

LINK TO THIS FORUM!

Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

Partner With Us!

"Best Of Breed" Forums Add Stickiness To Your Site
Partner Button
(Download This Button Today!)

Feedback

"...Within the first afternoon I found 2 of the 3 needed solutions, and the 3rd came to me over the weekend!..."

Geography

Where in the world do Tek-Tips members come from?
mptwoadmin (Programmer)
25 Jun 12 11:17
Hi,
I have a question regarding duplicate data entries. I would like to zero out all duplicate entries of '62945' but machine2 on Nov 18 2009. Is this possible? And how would you go about this?

date_id machine1 machine2 machine3
Nov 18 2009 12:00AM 62945 62945 53214
Nov 19 2009 12:00AM 62945 62945 62945
Nov 20 2009 12:00AM 62945 62945 62945
Nov 21 2009 12:00AM 62945 62945 62945
Nov 22 2009 12:00AM 62945 62945 62945
Nov 23 2009 12:00AM 62945 62945 62945
Nov 24 2009 12:00AM 62945 62945 62945


Thank You
Qik3Coder (Programmer)
25 Jun 12 11:51
You simply need something unique to attach to for your query. Normally this is an ID, but a date works just as well.

CODE

--Verify your filter criteria
SELECT * FROM yourTable
where Machine2 = '62945' AND date_id <> '2009-11-18'

--IF Correct
DELETE yourTable
where Machine2 = '62945' AND date_id <> '2009-11-18'

Lodlaiden

You've got questions and source code. We want both!
Oh? That? That's not an important password. - IT Security Admin (pw on whiteboard)

mptwoadmin (Programmer)
25 Jun 12 12:46
Hi, Your qry removes all entires for 'Nov 18 2009 12:00AM'. I need all entries for '62945' to be zero'd out but machine2 on 'Nov 18 2009 12:00AM'

Thank You.
Qik3Coder (Programmer)
25 Jun 12 12:51
This would remove ALL entries for machine2='62945' EXCEPT any entries on 11/18/2009

Are you saying that you have multiple entries for for "some" machine id on a single date, and need duplicates of those removed?
Except any duplicates for machine2 = 62945 on 11/18/2009?
Your sample set did not indicate that.

Could you provide a better "before/after" sample of what you're trying to accomplish?

Lodlaiden

You've got questions and source code. We want both!
Oh? That? That's not an important password. - IT Security Admin (pw on whiteboard)

bborissov (Programmer)
25 Jun 12 17:08
What defines you records as "duplicate"?
Why these records are duplicate?

date_id machine1 machine2 machine3
Nov 18 2009 12:00AM 62945 62945 53214
Nov 19 2009 12:00AM 62945 62945 62945

Borislav Borissov
VFP9 SP2, SQL Server

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close