J
jeff klein
Below is a query that shows "CarePlans" for all active customers. It only
shows careplans that exist between "MonthStartDate" and "MonthEndDate" which
Is entered during query execution.
What I also need to the query to show:
Only show the most recent care plan for each customer (presently is shows
all careplans for each customer)
Also show new careplans that fall between the "MonthStartDate" and
"MonthEndDate"
Note: The NZ function is used because noaend field frequently is not entered
(null)
PARAMETERS [MonthStartDate] DateTime, [MonthEndDate] DateTime;
SELECT [ClientLastName] & ", " & [ClientFirstName] AS ClientLastandFirst,
CarePlans.SOCStart, CarePlans.NOAEnd, nz([noaend],#12/31/9999#) AS
ActualNOAEnd
FROM Clients INNER JOIN CarePlans ON Clients.ClientID = CarePlans.ClientID
WHERE (((CarePlans.SOCStart)<=[MonthStartDate]) AND
((nz([noaend],#12/31/9999#))>=[MonthStartDate]) AND ((Clients.Inactive)=0))
ORDER BY [ClientLastName] & ", " & [ClientFirstName];
shows careplans that exist between "MonthStartDate" and "MonthEndDate" which
Is entered during query execution.
What I also need to the query to show:
Only show the most recent care plan for each customer (presently is shows
all careplans for each customer)
Also show new careplans that fall between the "MonthStartDate" and
"MonthEndDate"
Note: The NZ function is used because noaend field frequently is not entered
(null)
PARAMETERS [MonthStartDate] DateTime, [MonthEndDate] DateTime;
SELECT [ClientLastName] & ", " & [ClientFirstName] AS ClientLastandFirst,
CarePlans.SOCStart, CarePlans.NOAEnd, nz([noaend],#12/31/9999#) AS
ActualNOAEnd
FROM Clients INNER JOIN CarePlans ON Clients.ClientID = CarePlans.ClientID
WHERE (((CarePlans.SOCStart)<=[MonthStartDate]) AND
((nz([noaend],#12/31/9999#))>=[MonthStartDate]) AND ((Clients.Inactive)=0))
ORDER BY [ClientLastName] & ", " & [ClientFirstName];