A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » New Users
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

...how to filter/query records



 
 
Thread Tools Display Modes
  #1  
Old August 30th, 2005, 06:41 PM
Uwiprof
external usenet poster
 
Posts: n/a
Default ...how to filter/query records

i have a table with 20,000 records. one column includes names. another column
includes multiple dates the person visited a doctor, and another column
includes dates the person visited a hospital. i am only interested in the
last date the person visited a doctor and the last date the person visited a
hospital (if they had any visits to the doctor or hospital). I am also
interested in members who have had no visits to the doctor or hospital. any
suggestions on how i can filter the data to only return these records? thanks


Name Date Visited Doctor Date Visited Hospital
Nigel 01/01/1980 012/31/1995
05/20/1999 06/06/2005
03//02/2004 05/06/2004



For example, I only want to return

Nigel, 03/02/2004 (Date Visited Doctor), and 06/06/2005 (Date Visited
Hospital). thank you. i really appreciate any help you can offer.

  #2  
Old August 31st, 2005, 12:21 AM
KARL DEWEY
external usenet poster
 
Posts: n/a
Default

SELECT PatientVisit.Name, Max(PatientVisit.DoctorVisit) AS Doctor,
Max(PatientVisit.HospitalVisit) AS Hospitial
FROM PatientVisit
GROUP BY PatientVisit.Name;


"Uwiprof" wrote:

i have a table with 20,000 records. one column includes names. another column
includes multiple dates the person visited a doctor, and another column
includes dates the person visited a hospital. i am only interested in the
last date the person visited a doctor and the last date the person visited a
hospital (if they had any visits to the doctor or hospital). I am also
interested in members who have had no visits to the doctor or hospital. any
suggestions on how i can filter the data to only return these records? thanks


Name Date Visited Doctor Date Visited Hospital
Nigel 01/01/1980 012/31/1995
05/20/1999 06/06/2005
03//02/2004 05/06/2004



For example, I only want to return

Nigel, 03/02/2004 (Date Visited Doctor), and 06/06/2005 (Date Visited
Hospital). thank you. i really appreciate any help you can offer.

 




Thread Tools
Display Modes

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 Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Finding records with equal values in 3 fields Amir Running & Setting Up Queries 6 May 21st, 2005 04:43 AM
Appending ONLY new records to a table BillGrubbs Running & Setting Up Queries 0 April 27th, 2005 11:37 PM
count number of records Joe_Access General Discussion 1 January 13th, 2005 07:27 PM
append Query duplicating records Alex Running & Setting Up Queries 1 July 8th, 2004 01:31 PM
Query combining multiple records from one table can't add records Clint Marshall Running & Setting Up Queries 4 July 8th, 2004 01:25 PM


All times are GMT +1. The time now is 02:08 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.