I have created the following query:
SELECT
'A Review' AS [Work Stream],
Current_Wk.Person_Count,
Previous_Wk.Person_Count,
IIf([Current_Wk].[Person_Count]=[Previous_Wk].[Person_Count], "No Change", IIF([Previous_Wk].[Person_Count]>[Current_Wk].[Person_Count], "-" & ([Previous_Wk].[Person_Count]-[Current_Wk].[Person_Count]), "+" & ([Current_Wk].[Person_Count]-[Previous_Wk].[Person_Count]))) AS Difference
FROM
(SELECT Count(1) AS Person_Count
FROM (SELECT DISTINCT [Person ID] FROM [tblAReview])) AS Current_Wk,
(SELECT Count(1) AS Person_Count
FROM (SELECT DISTINCT [Person ID] FROM [tblAAReview])) AS Previous_Wk;
I wanted to add in two other columns to say whether the person has expired or not (in the current week). I have a column in the tblAAReview that gives this information.
How can I fit this in? Would a Where clause suffice?
SELECT
'A Review' AS [Work Stream],
Current_Wk.Person_Count,
Previous_Wk.Person_Count,
IIf([Current_Wk].[Person_Count]=[Previous_Wk].[Person_Count], "No Change", IIF([Previous_Wk].[Person_Count]>[Current_Wk].[Person_Count], "-" & ([Previous_Wk].[Person_Count]-[Current_Wk].[Person_Count]), "+" & ([Current_Wk].[Person_Count]-[Previous_Wk].[Person_Count]))) AS Difference
FROM
(SELECT Count(1) AS Person_Count
FROM (SELECT DISTINCT [Person ID] FROM [tblAReview])) AS Current_Wk,
(SELECT Count(1) AS Person_Count
FROM (SELECT DISTINCT [Person ID] FROM [tblAAReview])) AS Previous_Wk;
I wanted to add in two other columns to say whether the person has expired or not (in the current week). I have a column in the tblAAReview that gives this information.
How can I fit this in? Would a Where clause suffice?