L
Linda RQ
Hi Everyone,
I am using Access 2003. I have a query that I am trying to get to show only
patients on the adult areas. I only have 4 areas that are pediatric. Here
is my sql, but I used the query grid to make my query.
SELECT tblPatients.PtID, tblAreaList.AreaName, tblPtLocation.PtLocStDtTm,
tblPtLocation.PtLocEnDtTm
FROM tblPatients INNER JOIN (tblAreaList INNER JOIN tblPtLocation ON
tblAreaList.AreaID = tblPtLocation.AreaID_fk) ON tblPatients.PtID =
tblPtLocation.PtID_fk
GROUP BY tblPatients.PtID, tblPtLocation.AreaID_fk, tblAreaList.AreaName,
tblPtLocation.PtLocStDtTm, tblPtLocation.PtLocEnDtTm
HAVING ((Not (tblPtLocation.AreaID_fk)=17)) OR ((Not
(tblPtLocation.AreaID_fk)=18)) OR ((Not (tblPtLocation.AreaID_fk)=19)) OR
((Not (tblPtLocation.AreaID_fk)=20));
tblPatients is related to tblPtLocation via PtID. tblPtLocation is related
to tblAreaList via Area ID
When I run the query, only the area 17 is filtered out.
Thanks,
Linda
I am using Access 2003. I have a query that I am trying to get to show only
patients on the adult areas. I only have 4 areas that are pediatric. Here
is my sql, but I used the query grid to make my query.
SELECT tblPatients.PtID, tblAreaList.AreaName, tblPtLocation.PtLocStDtTm,
tblPtLocation.PtLocEnDtTm
FROM tblPatients INNER JOIN (tblAreaList INNER JOIN tblPtLocation ON
tblAreaList.AreaID = tblPtLocation.AreaID_fk) ON tblPatients.PtID =
tblPtLocation.PtID_fk
GROUP BY tblPatients.PtID, tblPtLocation.AreaID_fk, tblAreaList.AreaName,
tblPtLocation.PtLocStDtTm, tblPtLocation.PtLocEnDtTm
HAVING ((Not (tblPtLocation.AreaID_fk)=17)) OR ((Not
(tblPtLocation.AreaID_fk)=18)) OR ((Not (tblPtLocation.AreaID_fk)=19)) OR
((Not (tblPtLocation.AreaID_fk)=20));
tblPatients is related to tblPtLocation via PtID. tblPtLocation is related
to tblAreaList via Area ID
When I run the query, only the area 17 is filtered out.
Thanks,
Linda