Display item by group

TeeChart for ActiveX, COM and ASP
Post Reply
onyx
Newbie
Newbie
Posts: 6
Joined: Fri Nov 15, 2002 12:00 am
Location: Kuala Lumpur
Contact:

Display item by group

Post by onyx » Mon Jun 09, 2008 9:00 am

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
i'm not perfect person! there's many things i wish i didn't do, but i continue learning...

Raziedahanin Kasim
CMEwww Sdn. Bhd / ONYX Enterprise

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Mon Jun 09, 2008 9:14 am

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.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply