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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

When I query i get to much data

Status
Not open for further replies.

emansplz

Technical User
Nov 11, 2002
6
0
0
US
Using the Query Wizard I have built a query that is by Name, ID #, Diagnosis, and Stage of Diagnosis using our Patient database. When the query loads it showes the patient by diagnosis like I want but it shows every time they have come in. is there a way to show the patient just 1 time?
 
If there is a date field in the query in question try removing it. Group By does just what the name implies it will uniquely group the data returned from the query based on unique values.

So if all your values are unique the Group By and Select query will return the same number of records,

HTH,

Steve
 
Table

PatientID - Number
datetime - Date Time


In order to get a list of every patient showing their last datetime only , use :

SELECT Table1.PatientID, Last(Table1.dateTime) AS LastOfdateTime
FROM Table1
GROUP BY Table1.PatientID
ORDER BY Table1.PatientID;

Regards

BuilderSpec
 
.....is there a way to show the patient just 1 time?[/red]

When you indicate one time, what are you referring to?? Is it the last time (date) or a particular date??

If you mean last time ----- will need to have the date field in the query and use the Dmax function
If a particular date ---- put in the criteria of the query in the date field [Please Enter Date]


HTH

An investment in knowledge always pays the best dividends.
by Benjamin Franklin
 
Or...
Change "select" to "select distinct" in the sql window.

Eric
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top