query helppppppppppp

M

mhmaid

i have a table to enter patients details.somtimes one patient will have many
visits and many records.How can i obtain the actual list of patients
regardless of visits(one record only for each patient).how to make query like
this.i want query to list the actual no of patients.I.e.if the patient John
smith has ten visits.in this list should have only one record.
 
L

Lucas Kartawidjaja

Hi there

Not sure if I got your questions totally. However, assuming that the
patients details have patient id field, you can try to use the following
query:

SELECT DISTINCT patientid, firstname, lastname
FROM [table_name];

Lucas
 
C

Craig Hornish

As in Lucas's post the DISTINCT is the keword - if you use design view
that would be "Unique values" in the the properties window for the query.
Hopefully you have a table of patient names and then the details of
their visists and not having their names in the "details" table - In this
case when you only want patients that have visits, you will have a join with
the details table. Just make sure you don't include fields in the details
table that would have different values or you will get duplicates.

Craig Hornish
 
M

mhmaid

thanks for reply.
actually the table that i have is called "patients" and it includes fields
like country ,patientname.one patient may have many visits .so will have many
records in this table.my boss is asking me to create a list with the real
number of patients.
suppose patient A got ten visits.(ten records),he wants me to count them as
one (1) patient and give a list of names with no duplicates (patient A, for
example , his name should appear only once in the list ) although he got 10
visits.(ten records).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top