Showing zero counts

  • Thread starter Thread starter Amy
  • Start date Start date
A

Amy

I have a table where each time a patient is seen we find
out what hospital they originally came from. This is
entered for each person on the date they arrive. I also
have a table listing all the hospital location options and
I have them link through a relationship.

Now, I want to query the counts for each hospital within a
given time frame, but not only do I want it to list the
hospital that have numbers, but rather list all the
hospitals and put zeros where none were seen.

Does that make more since? I am wondering if it is a
relationship probelm or what.

Thanks,
Amy
 
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Use a LEFT JOIN between the hospitals table and the visits table. E.g.:

SELECT H.HospitalName, V.PatientID, V.VisitDate
FROM Hospitals As H LEFT JOIN Visits As V
ON H.HospitalID = V.HospitalID
WHERE <..criteria..>

--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQMYBhYechKqOuFEgEQIhwgCdFifxbJPxDWWOs2YS7/mi2fLKT2QAoJ+m
CuC+dzrMMTof4mNRLmWUd1TU
=DgKJ
-----END PGP SIGNATURE-----
 
Back
Top