Using Access97.
The data is in a table with date and type of intervention fields. I need is count of type of interventions for each month on a dynamic report - eg the last 12 months.
tbintervention
date type
1/1/04 ABX
1/1/04 PNE
1/2/04 ABX
2/1/04 ABX
3/1/04 CLA
3/12/04 DOSH
3/12/04 THER
running the following query:
SELECT DISTINCT tbIntervention.date, Count(tbIntervention.type) AS CountOftype
FROM tbIntervention
GROUP BY tbIntervention.date
HAVING (((tbIntervention.date) Between #1/1/2004# And #1/31/2004#))
ORDER BY tbIntervention.date;
gives:
date countoftype
1/1/04 2
1/2/04 1
2/1/04 1
3/1/04 1
3/12/04 2
then running the following query:
SELECT Sum(qryMonthByDay.CountOftype) AS Total
FROM qryMonthByDay;
results with a value of 3 (using the dates above).
What I need is select statement which will produce a month and number of interventions which may then be charted:
Month #interv
Jan2004 3
Feb2004 1
Mar2004 3
etc...
Any suggestions? Thank you.
The data is in a table with date and type of intervention fields. I need is count of type of interventions for each month on a dynamic report - eg the last 12 months.
tbintervention
date type
1/1/04 ABX
1/1/04 PNE
1/2/04 ABX
2/1/04 ABX
3/1/04 CLA
3/12/04 DOSH
3/12/04 THER
running the following query:
SELECT DISTINCT tbIntervention.date, Count(tbIntervention.type) AS CountOftype
FROM tbIntervention
GROUP BY tbIntervention.date
HAVING (((tbIntervention.date) Between #1/1/2004# And #1/31/2004#))
ORDER BY tbIntervention.date;
gives:
date countoftype
1/1/04 2
1/2/04 1
2/1/04 1
3/1/04 1
3/12/04 2
then running the following query:
SELECT Sum(qryMonthByDay.CountOftype) AS Total
FROM qryMonthByDay;
results with a value of 3 (using the dates above).
What I need is select statement which will produce a month and number of interventions which may then be charted:
Month #interv
Jan2004 3
Feb2004 1
Mar2004 3
etc...
Any suggestions? Thank you.