K
ken
When I run the following query I get an error "You tried to execute a query
that does not include the specified expression 'Format(opendate, 'yyyy.mm.')
& '01" as part of an aggregate function. What I'm trying to get is the date
to sort by the month i.e Jan, Feb, Mar. I'm not sute what I need to do to
get the results that I need.
Thanks
Ken
SELECT
Format(opendate, 'yyyy.mm.') & '01' As FirstOfMonth,
Format([opendate],' mmmm yyyy') AS [Month],
Count(calls.Severity1) AS CountOfSeverity1,
Count(calls.Severity2) AS CountOfSeverity2,
Sum(IIf(calls.Calltyp="Question",1,0)) AS Question,
Sum(IIf(calls.Calltyp="Other",1,0)) AS Other,
Count(Format([opendate],' mmmm')) AS total
FROM calls
GROUP BY Format([opendate],'01 mmmm yyyy'),
Month([opendate])
UNION
SELECT
'3000.01.01',
"Total",
Count(calls.Severity1) AS CountOfSeverity1,
Count(calls.Severity2) AS CountOfSeverity2,
Sum(IIf(calls.Calltyp="Question",1,0)) AS Question,
Sum(IIf(calls.Calltyp="Other",1,0)) AS Other,
Count(Format([opendate],' mmmm')) AS total
FROM calls
ORDER BY FirstOfMonth
that does not include the specified expression 'Format(opendate, 'yyyy.mm.')
& '01" as part of an aggregate function. What I'm trying to get is the date
to sort by the month i.e Jan, Feb, Mar. I'm not sute what I need to do to
get the results that I need.
Thanks
Ken
SELECT
Format(opendate, 'yyyy.mm.') & '01' As FirstOfMonth,
Format([opendate],' mmmm yyyy') AS [Month],
Count(calls.Severity1) AS CountOfSeverity1,
Count(calls.Severity2) AS CountOfSeverity2,
Sum(IIf(calls.Calltyp="Question",1,0)) AS Question,
Sum(IIf(calls.Calltyp="Other",1,0)) AS Other,
Count(Format([opendate],' mmmm')) AS total
FROM calls
GROUP BY Format([opendate],'01 mmmm yyyy'),
Month([opendate])
UNION
SELECT
'3000.01.01',
"Total",
Count(calls.Severity1) AS CountOfSeverity1,
Count(calls.Severity2) AS CountOfSeverity2,
Sum(IIf(calls.Calltyp="Question",1,0)) AS Question,
Sum(IIf(calls.Calltyp="Other",1,0)) AS Other,
Count(Format([opendate],' mmmm')) AS total
FROM calls
ORDER BY FirstOfMonth