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!

Looping and inserting thorugh table

Status
Not open for further replies.

LeighDreyer

Programmer
Mar 4, 2003
16
0
0
GB
I have a table which has 4 fields WARD_NAME, REF_DATE, SEX, OVER_65. This table holds details about patients that have been to a ward and how many days they have been in the ward and whether they are over 65 and Male or female sample table below. As you will see in Ref_date there are 2 occurrances of the dates which means 2 people have been in that ward for the day. I need to be able to produce a count for each day that tells me if they are female and over 65, and another count that tells me if they are female and under 65.

WARD_NAME REF_DATE SEX OVER_65 Fem_>_65 Fem_<_65
Ward 1 01/01/02 M Y 0 0
ward 1 02/01/02 M N 0 0
ward 1 02/01/02 M N 0 0
ward 1 03/01/02 F N 0 1
ward 1 04/01/02 F N 0 2
ward 1 04/01/02 F N 0 2
ward 1 04/01/02 F N 0 3

sample table is what I want you see the count imcreases because there have been 3 females under 65 at the ward on the same day

does anyone no how I can do this ?.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top