Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

set complex sort criteria

Status
Not open for further replies.

SMHSleepy

Technical User
Sep 8, 2009
174
CA
Hello, I have a database that logs patient visits to our lab. Some tests involve returning the very next day for another test. I want to make a query that shows a sorted list of patients based on study date, except when the patient returns the very next day I want the second visit to be shown directly underneath the first visit. This should only apply to subsequent day visits as the same patient may have been here months or years ago also. To simplify things, here are just some fields in my table which may help: ID (autonumber), PtID, LName, FName, StudyDate, StudyType
PtID is unique to each patient.
StudyType differentiates the 2 different tests (ie. day1 and day2).

I hope this makes sense. Any suggestions?
 
Thanks for your quick response and sorry for my late one. I've decided to just ask the users to enter the second visit directly after the first visit since this will be known in advance and there will be so few of this scenario anyway. It's not a big deal. Please see the post I'm about to make in the forms forum. It's a more challenging problem. Thanks again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top