G
gregatvrm
I am trying to find how many people of a certain sex returned in the same
year and it keeps giving me both records of the same person. How do i get it
to return only the one record. Also if there is a null response it needs to
return a zero.
SELECT Count(History.RESID) AS NumberOfDups
FROM RESIDENT INNER JOIN History ON RESIDENT.RESID = History.RESID
WHERE (((History.ExitDate) Between #1/1/2007# And #12/31/2007#) AND
((RESIDENT.Sex)="f")) OR (((History.ExitDate) Is Null))
GROUP BY RESIDENT.LastName, RESIDENT.FirstName, History.RESID
HAVING (((Count(History.RESID))>1));
year and it keeps giving me both records of the same person. How do i get it
to return only the one record. Also if there is a null response it needs to
return a zero.
SELECT Count(History.RESID) AS NumberOfDups
FROM RESIDENT INNER JOIN History ON RESIDENT.RESID = History.RESID
WHERE (((History.ExitDate) Between #1/1/2007# And #12/31/2007#) AND
((RESIDENT.Sex)="f")) OR (((History.ExitDate) Is Null))
GROUP BY RESIDENT.LastName, RESIDENT.FirstName, History.RESID
HAVING (((Count(History.RESID))>1));