Let’s see if I can explain this properly.
I am (unfortunately) using Access.
I have a table as such:
Date | ResID | Med | time | emar |
___________+_________+_________+_________+________|
11/18/2010 | 72 | Aspirin | 8:00 AM | 427 |
11/19/2010 | 72 | Aspirin | 8:00 AM | 427 |
11/20/2010 | 72 | Aspirin | 8:00 AM | 427 |
11/18/2010 | 72 | Aspirin | 2:00 PM | 427 |
11/19/2010 | 72 | Aspirin | 2:00 PM | 427 |
11/20/2010 | 72 | Aspirin | 2:00 PM | 427 |
11/18/2010 | 73 | Aspirin | 7:00 AM | 428 |
11/19/2010 | 73 | Aspirin | 7:00 AM | 428 |
...etc
I know this could be set up much better, but unfortunately this is all I have with which to work.
How could I query this database such that it would return only one row for each matching set of ResID, Med, Time and emar? So the result I’m looking for from this example would be:
Date | ResID | Med | time | emar |
___________+_________+_________+_________+________|
11/18/2010 | 72 | Aspirin | 8:00 AM | 427 |
11/18/2010 | 72 | Aspirin | 2:00 PM | 427 |
11/18/2010 | 73 | Aspirin | 7:00 AM | 428 |
The date doesn’t matter except that it must be in a specified range: date_min to date_max. This is in ColdFusion if it makes a difference.
1 Answer