Display item by group
Posted: Mon Jun 09, 2008 9:00 am
This is my MS SQL query
this gave result as below
LicenseNo month bilPatient
MYCLD00008 1 1
MYCLD00008 8 9
MYCLD00008 10 10
MYMCD00009 10 2
MYCLR00032 11 1
MYCLR00032 12 1
I want to dispaly this data in a bar chart with XValues: month, YValues: bilPatient and group by month or group by LicenseNo.
Hope somebody can advice and guide me how to do it
Thank you in advance
Code: Select all
select LicenseNo, month(timeIN) as month, count(visitID) as bilPatient
from visit
where HQLicenseNO='MYHQD00007' and year(timeIn)=2007
group by LicenseNo, month(timeIN)
order by month
LicenseNo month bilPatient
MYCLD00008 1 1
MYCLD00008 8 9
MYCLD00008 10 10
MYMCD00009 10 2
MYCLR00032 11 1
MYCLR00032 12 1
I want to dispaly this data in a bar chart with XValues: month, YValues: bilPatient and group by month or group by LicenseNo.
Hope somebody can advice and guide me how to do it
Thank you in advance