A
Al
I currently have a query that I use to review individuals who've called more
than once within a month (based on a few criteria, but most importantly a
field called Level-1 and Case-ID for counting # unique entries).
People are defined with the Name field in the SQL below (which is based on
IIF statement).
What I need to do is have a query that by month shows % repeat callers
against % non-repeat... This would be based on the following:
1) Repeat - Where Name field has more than one entry within the given month
and the conditions within the SQL (i.e. Name not like *[?]* and Closed-Date
is Not Null and Level-1 Not like z*)
2) Unique (Non-Repeat) - Where Name field contains only one case within the
given month
Ideally I'd like this to appear as follows:
Month Repeat % Non-Repeat %
Jan 5% 95%
Feb 7% 93%
Mar 4% 96%
etc...
Appreciate any help as I'm completely stumped on how to do this!!..
Thanks, Al.
SQL:
SELECT IIf([Customer-Type]="Internal",[First-Name-+] & " " &
[Last-Name-+],[Supplier-Name]) AS Name, [P2P-Request].[Organisation-Level-2],
[P2P-Request].[Level-1], Count([P2P-Request].[Case-ID]) AS [CountOfCase-ID],
Left(MonthName(Month([Create-Date])),3) AS [Month]
FROM [P2P-Request]
WHERE (((Year([Create-Date]))=[Enter Year]) AND
(([P2P-Request].[Closed-Date]) Is Not Null) AND (([P2P-Request].[Level-1])
Not Like "z*"))
GROUP BY IIf([Customer-Type]="Internal",[First-Name-+] & " " &
[Last-Name-+],[Supplier-Name]), [P2P-Request].[Organisation-Level-2],
[P2P-Request].[Level-1], Left(MonthName(Month([Create-Date])),3)
HAVING (((IIf([Customer-Type]="Internal",[First-Name-+] & " " &
[Last-Name-+],[Supplier-Name])) Not Like "*[?]*") AND
((Count([P2P-Request].[Case-ID]))>1))
ORDER BY IIf([Customer-Type]="Internal",[First-Name-+] & " " &
[Last-Name-+],[Supplier-Name]), Count([P2P-Request].[Case-ID]);
than once within a month (based on a few criteria, but most importantly a
field called Level-1 and Case-ID for counting # unique entries).
People are defined with the Name field in the SQL below (which is based on
IIF statement).
What I need to do is have a query that by month shows % repeat callers
against % non-repeat... This would be based on the following:
1) Repeat - Where Name field has more than one entry within the given month
and the conditions within the SQL (i.e. Name not like *[?]* and Closed-Date
is Not Null and Level-1 Not like z*)
2) Unique (Non-Repeat) - Where Name field contains only one case within the
given month
Ideally I'd like this to appear as follows:
Month Repeat % Non-Repeat %
Jan 5% 95%
Feb 7% 93%
Mar 4% 96%
etc...
Appreciate any help as I'm completely stumped on how to do this!!..
Thanks, Al.
SQL:
SELECT IIf([Customer-Type]="Internal",[First-Name-+] & " " &
[Last-Name-+],[Supplier-Name]) AS Name, [P2P-Request].[Organisation-Level-2],
[P2P-Request].[Level-1], Count([P2P-Request].[Case-ID]) AS [CountOfCase-ID],
Left(MonthName(Month([Create-Date])),3) AS [Month]
FROM [P2P-Request]
WHERE (((Year([Create-Date]))=[Enter Year]) AND
(([P2P-Request].[Closed-Date]) Is Not Null) AND (([P2P-Request].[Level-1])
Not Like "z*"))
GROUP BY IIf([Customer-Type]="Internal",[First-Name-+] & " " &
[Last-Name-+],[Supplier-Name]), [P2P-Request].[Organisation-Level-2],
[P2P-Request].[Level-1], Left(MonthName(Month([Create-Date])),3)
HAVING (((IIf([Customer-Type]="Internal",[First-Name-+] & " " &
[Last-Name-+],[Supplier-Name])) Not Like "*[?]*") AND
((Count([P2P-Request].[Case-ID]))>1))
ORDER BY IIf([Customer-Type]="Internal",[First-Name-+] & " " &
[Last-Name-+],[Supplier-Name]), Count([P2P-Request].[Case-ID]);