Hi,
It's a little off-topic, because it's not about Pascal or Lazarus, but it will be used in a Lazarus application, so I dare to ask here ;-). I have a table with data, using Firebird. I want to have some statistics so I use this query :
select a.TYPE, COUNT(*)
from Table a
WHERE a.date between '1.1.2008' and '31.12.2008'
GROUP by a.TYPE
I also want it for the next year :
select a.TYPE, COUNT(*)
from Table a
WHERE a.date between '1.1.2009' and '31.12.2009'
GROUP by a.TYPE
This way I get two dbgrids of data, or two graphs. I would like to have 1 grid, with three columns : type, count for 2008 and count for 2009, to compare them and to graph them next to eachother. That's where I'm stuck.
Anyone has suggestions ?
I googled for pivottable or cross tab, but I didn't find how to create the data from a database.
I have a rather good textbook about databases (using Interbase !) but I didn't find anything giving me usefull idea's.
I tried with a union of the both statements, but that does not create an extra column of data, it "mixes" the two datasets into one column. I tried grouping by date, but that gives an extra column with only years.
Thanks,
Koenraad Lelong.
