having troubles with sorting data based on date parts
having troubles with sorting data based on date parts
(OP)
I want to group data based on the Month and Year for counts.
I have a field that is Date/Time named [callstartdate] and I keep getting an error with the following code
All I get is 'A Syntax Error has occured' Where is my hangup?
I have a field that is Date/Time named [callstartdate] and I keep getting an error with the following code
CODE
select
Year(Callstartdate) Year,
month(callstartdate) Month,
appname,
count(sessionid) Total_Calls
from
vxmlsession
where
month(callstartdate) = 6
and year(callstartdate) = 2008
group by
year(callstartdate),
Month(callstartdate),
appname
order by
appname ASC
Year(Callstartdate) Year,
month(callstartdate) Month,
appname,
count(sessionid) Total_Calls
from
vxmlsession
where
month(callstartdate) = 6
and year(callstartdate) = 2008
group by
year(callstartdate),
Month(callstartdate),
appname
order by
appname ASC
All I get is 'A Syntax Error has occured' Where is my hangup?
RE: having troubles with sorting data based on date parts
CODE
Year(Callstartdate) Year,
month(callstartdate) Month,
appname,
count(sessionid) Total_Calls
from
vxmlsession
where
month(callstartdate) > 5
and year(callstartdate) = 2008
group by
1,
2,
appname
order by
appname ASC