K
kmj1906
I am trying to use the ecount function:
CountOfAcct Number: ECount("[Acct Number]","[2a-Bad Phone Query]","[PAS Name]
='ATLANTA PAS'",True)
It seems to give me the correct total, however, I am trying to also group it
by patient type. For example, The total distinct count is 1,000 but
everytime I run the query it gives me:
ATLANTA PAS Emergency Room 1000
ATLANTA PAS Surgery 1000
ATLANTA PAS Inpatient 1000
ATLANTA PAS Outpatient 1000
However, what I really need is below (which is the true distinct count of
each patient type):
ATLANTA PAS Emergency Room 500
ATLANTA PAS Surgery 250
ATLANTA PAS Inpatient 200
ATLANTA PAS Outpatient 50
I am not very familiar with how the syntax of Ecount should be written to
accomplish this: Below is the total sql statement:
SELECT [2a-Bad Phone Query].[PAS Name], [2a-Bad Phone Query].[PT Type Name],
ECount("[Acct Number]","[2a-Bad Phone Query]","[PAS Name]='ATLANTA PAS'",True)
AS [CountOfAcct Number], Sum([2a-Bad Phone Query].Balance) AS SumOfBalance
FROM [2a-Bad Phone Query]
GROUP BY [2a-Bad Phone Query].[PAS Name], [2a-Bad Phone Query].[PT Type Name]
HAVING ((([2a-Bad Phone Query].[PAS Name])="Atlanta Pas"));
If someone could please help, I would be very appreciative..I have been
looking at this for a while
THank you
CountOfAcct Number: ECount("[Acct Number]","[2a-Bad Phone Query]","[PAS Name]
='ATLANTA PAS'",True)
It seems to give me the correct total, however, I am trying to also group it
by patient type. For example, The total distinct count is 1,000 but
everytime I run the query it gives me:
ATLANTA PAS Emergency Room 1000
ATLANTA PAS Surgery 1000
ATLANTA PAS Inpatient 1000
ATLANTA PAS Outpatient 1000
However, what I really need is below (which is the true distinct count of
each patient type):
ATLANTA PAS Emergency Room 500
ATLANTA PAS Surgery 250
ATLANTA PAS Inpatient 200
ATLANTA PAS Outpatient 50
I am not very familiar with how the syntax of Ecount should be written to
accomplish this: Below is the total sql statement:
SELECT [2a-Bad Phone Query].[PAS Name], [2a-Bad Phone Query].[PT Type Name],
ECount("[Acct Number]","[2a-Bad Phone Query]","[PAS Name]='ATLANTA PAS'",True)
AS [CountOfAcct Number], Sum([2a-Bad Phone Query].Balance) AS SumOfBalance
FROM [2a-Bad Phone Query]
GROUP BY [2a-Bad Phone Query].[PAS Name], [2a-Bad Phone Query].[PT Type Name]
HAVING ((([2a-Bad Phone Query].[PAS Name])="Atlanta Pas"));
If someone could please help, I would be very appreciative..I have been
looking at this for a while
THank you