![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I am trying to find all duplicate values in a 7-day date range so that if an item/customer combination exists more than once either 3-days before or after the date being evaluated it will be returned as having a duplicate. All days in the table need to be evaluated in a loop fashion so that each item is compared to all duplicate item/customer combinations in the 3-day period before or after the sale date. |
#3
| |||
| |||
|
#4
| |||
| |||
|
|
I apologize for any confusion my question my have caused. I am hoping to get suggestions on how to develop a query to return all duplicate records for an entire table--a duplicate row would have an identical customer and item that was recorded 3-days before or 3-days after the date of the row being evaluated. Since each record in a 1-year timeframe is being evaluated, I'm unsure how to specify the date range (it changes relative to each row). I appreciate any suggestions you may have. |
#5
| |||
| |||
|
|
I am trying to find all duplicate values in a 7-day date range so that if an item/customer combination exists more than once either 3-days before or after the date being evaluated it will be returned as having a duplicate. All days in the table need to be evaluated in a loop fashion so that each item is compared to all duplicate item/customer combinations in the 3-day period before or after the sale date. For example, with: Column 1: Date Column 2: Item Column 3: Customer And values: 1/1/06 Item A Customer A 1/2/06 Item A Customer A 1/3/06 Item B Customer A 1/4/06 Item A Customer A When 1/2/06 is evaluated it would evaluate Item A/Customer A as a duplicate because an equivalent item was found on 1/1/06 and on 1/4/06. In this example, 1/1/06, 1/2/06, and 1/4/06 would all be returned as duplicates. |
#6
| |||
| |||
|
#7
| |||
| |||
|
![]() |
| Thread Tools | |
| Display Modes | |
| |