Help with Query for a Chart

Hodges

New member
Local time
Today, 20:42
Joined
Mar 17, 2006
Messages
8
Hey,

I have a table with a date of birth field and I need to produce a pie chart showing age groups from this.

The groups should be:

< 16

> 15 < 18

> 17


Help me!
 
Last edited:
Ok I've done the queries and managed to get a single query with the 3 results I want by first putting these 3 select statements as individual queries:

SELECT Count(*) AS Age1
FROM tblMemReg
WHERE ((Round(DateDiff("d",[DOB],Now())/365.25))<16);

SELECT Count(*) AS Age2
FROM tblMemReg
WHERE ((Round(DateDiff("d",[DOB],Now())/365.25)>15) And (Round(DateDiff("d",[DOB],Now())/365.25)<18));

SELECT Count(*) AS Age3
FROM tblMemReg
WHERE ((Round(DateDiff("d",[DOB],Now())/365.25))>17);


Then merging them into one query:

SELECT qryAge1.Age1, qryAge2.Age2, qryAge3.Age3
FROM qryAge1, qryAge2, qryAge3;

___________________

This outputs:

Age1 | Age2 | Age3
.....3 .......2 ........7

(And I have 12 rows in the tblMemReg table)
___________________

Now if I use the chart wizard and get it to use the last merged-results query, it doesn't work.
 

Users who are viewing this thread

Back
Top Bottom