Page 1 of 1

Display item by group

Posted: Mon Jun 09, 2008 9:00 am
by 9078654
This is my MS SQL query

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
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 :lol:
Thank you in advance

Posted: Mon Jun 09, 2008 9:14 am
by narcis
Hi onyx,

In that case you could try using CrossTab feature as shown in the All Features\Welcome!\DataBase Charts\DC CrossTab source example at the features demo. You'll also find additional information in Tutorial 8 - ADO Database access. Tutorials and demo can be found at TeeChart's program group.