Microsoft Access Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsDatabaseMicrosoft Access Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old November 19th, 2003, 05:14 AM
tintin tintin is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Posts: 7 tintin User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Help with duplicates query

I have a table with various fields, two of which are "date" and "serial number". I'm trying to construct a query which will return all records unless there are multiple matches in the "serial number" field , in which case the following should happen;
duplicate "serial number" entries should be checked to see if they fall within 5 days of each other as defined by the "date" field. If so, the newer record should be discounted from the query but not deleted from the table.

Given the table serial number date other fields
123 01/01/01 xxxxx
123 07/01/01 yyyyy
123 08/01/01 zzzzz

the query result should be
serial number date other fields
123 01/01/01 xxxxx
123 07/01/01 yyyyy

Can anyone help with this?

Reply With Quote
  #2  
Old November 19th, 2003, 01:21 PM
sbaxter sbaxter is offline
Moderator: Access, SQL
ASP Free God (5000 - 5499 posts)
 
Join Date: Oct 2003
Posts: 5,126 sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 4 Days 1 h 2 m 51 sec
Reputation Power: 12
tintin

Look at the attached DB,

Look at table1
then run query 2

It takes two queries to do what you want

S-

Reply With Quote
  #3  
Old November 21st, 2003, 03:34 PM
tintin tintin is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Posts: 7 tintin User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thanks a million S. I modified your solution to fit my db and it works perfectly. Nice to have you around.
Tintin

Reply With Quote
Reply

Viewing: ASP Free ForumsDatabaseMicrosoft Access Help > Help with duplicates query


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway