Share your Row Source SQL View.

Signature
Duane Hookom
MS Access MVP
--
Thanks for the response Duane. Here's the underlying query in SQL view, and
following that is the row source for the report in SQL view.
QuerySQL:
SELECT [TblDemographics].[MotherEducation],
Count([TblDemographics].[MotherEducation]) AS CountOfMotherEducation
FROM TblDemographics
GROUP BY [TblDemographics].[MotherEducation], IIf([MotherEducation]="8th
Grade or Less",1,IIf([MotherEducation]="sp ed --1 yr high
school",2,IIf([MotherEducation]="Some High
School",3,IIf([MotherEducation]="High School
Grad/GED",4,IIf([MotherEducation]="Some College",5)))))
ORDER BY IIf([MotherEducation]="8th Grade or
Less",1,IIf([MotherEducation]="sp ed --1 yr high
school",2,IIf([MotherEducation]="Some High
School",3,IIf([MotherEducation]="High School
Grad/GED",4,IIf([MotherEducation]="Some College",5)))));
Row Source SQL view:
SELECT QryAggregateEducation.MotherEducation,
Sum(QryAggregateEducation.CountOfMotherEducation) AS
SumOfCountOfMotherEducation
FROM QryAggregateEducation
GROUP BY QryAggregateEducation.MotherEducation;
> Share your Row Source SQL View.
>
[quoted text clipped - 15 lines]
> > change
> > the data labels. What am I doing wrong?? Any help is appreciated.
Duane Hookom - 01 Dec 2005 16:32 GMT
Do yourself a favor and add a field or make a table so you can store the
sorting values...
MotherEducation SortVal
8th Grade or Less 1
sp ed --1 yr high school 2
Some High School 3
Then add the SortVal column to your first query and group by it so you can
get rid of those horrible nested IIf()s.
Use the SortVal in your Row Source like:
SELECT QryAggregateEducation.MotherEducation,
Sum(QryAggregateEducation.CountOfMotherEducation) AS
SumOfCountOfMotherEducation
FROM QryAggregateEducation
GROUP BY SortVal, QryAggregateEducation.MotherEducation
ORDER BY SortVal, MotherEducation;

Signature
Duane Hookom
MS Access MVP
--
> Thanks for the response Duane. Here's the underlying query in SQL view,
> and
[quoted text clipped - 49 lines]
>> > change
>> > the data labels. What am I doing wrong?? Any help is appreciated.
Tara - 01 Dec 2005 18:38 GMT
Thanks Duane! It worked. I had played around with the Row Source before I
posted but still couldn't get it. I don't think I tried putting it into the
GROUP BY statement though, only the ORDER BY.
> Do yourself a favor and add a field or make a table so you can store the
> sorting values...
[quoted text clipped - 67 lines]
> >> > change
> >> > the data labels. What am I doing wrong?? Any help is appreciated.