RE: Access chart reports
- From: Duane Hookom <duanehookom@xxxxxxxxxxxxxxxxxx>
- Date: Wed, 22 Aug 2007 18:58:00 -0700
You are close with your union query. I'm not sure if your table name is
tblStudents or "that table is just called students"...
This sql should be a good start if you have a Primary Key field StudentId
and your table name is tblStudents:
SELECT StudentID, "AggressionVerbalPresent" As Behaviour
FROM tblStudents
WHERE [AggressionVerbalPresent] = TRUE
UNION ALL
SELECT StudentID, "AggressionPhysicalPresent"
FROM tblStudents
WHERE [AggressionPhysicalPresent] = TRUE;
--
Duane Hookom
Microsoft Access MVP
"Monique" wrote:
I just tried to do a union query, I've never done them before, this is how I.
did it:
SELECT StudentID, "AggressionVerbalPresent"
FROM tblStudents
WHERE [AggressionVerbalPresent] = TRUE
UNION ALL
SELECT StudentID, "AggressionPhysicalPresent"
FROM tblStudents
WHERE [AggressionPhysicalPresent] = TRUE
UNION ALL
But it didn't work, it came back with an error message "Syntex error in
query. Incomplete clause."
I'm not sure what I'm doing wrong, I have the record names exactly how they
are in the table, that table is just called students so I've done that. The
thing is when I say = TRUE, I think when a tick is used for a check box it
sees it as being -1 for some reason, I tried using both = TRUE and = -1 but
that didn't work either.
Monique
"Duane Hookom" wrote:
Your table structure sounds like a spread*** rather than a relational
database. Either normalize your structure or use a union query like
SELECT StudentID, "ADHD" as Behaviour
FROM tblStudentSpread***
WHERE [ADHD] = True
UNION ALL
SELECT StudentID, "Autism"
FROM tblStudentSpread***
WHERE [Autism] = True
UNION ALL
... etc ...
You can then create a graph based on the union query.
--
Duane Hookom
Microsoft Access MVP
"Monique" wrote:
I'm putting together a student database and to do some charts, I want to do a
pie chart with a break up of different behaviours by percentage, in the
actual form I've got check boxes against each student and have checked off
the behaviours displayed so I'm wondering how I can say 50% for example show
violence, 20% show impulsive behaviours etc etc when I don't have numbers as
such to draw from I only have check boxes against each child? Any ideas how
to do this.
I also want to do a graph as well with number of children with ADHD, number
with Autism etc etc, any help would really be appreciated.
Thanks
- Follow-Ups:
- RE: Access chart reports
- From: Monique
- RE: Access chart reports
- Prev by Date: Re: Print all records on a report ONLY IF Invoice NO is same
- Next by Date: Re: report wizard hangs
- Previous by thread: RE: Access chart reports
- Next by thread: RE: Access chart reports
- Index(es):
Loading