I have an inquiry regarding using Queries in and as the "Record Source" of a Report...
I have a single Access Report named rptDemographics I am trying to gather a variety of information into and display.
I have a quite elaborate and useful union query [with the aid of a developer I might add] that I am using as the REPORT "RECORD SOURCE"
However, the issue of displaying this information on a single Report eludes me...
The query below displays the data well enough as an executed query but to get that information in a usable form into a REPORT...
The QUERY that is used and referenced as the "Record Source" of my REPORT:
SELECT "Industry" as TheAttrib, [Industry] as TheValue, Count(*) as NumOf
FROM tblBusinessData
GROUP BY [Industry]
UNION ALL
SELECT "BusinessTitle", [BusinessTitle], Count(*)
FROM tblBusinessData
GROUP BY [BusinessTitle]
UNION ALL
SELECT "Location", [Location], Count (*)
FROM qryLocation
GROUP BY [Location]
UNION ALL
SELECT "Degree", [Degree], Count (*)
FROM tblDegree
GROUP BY [Degree]
UNION ALL
SELECT "Gender", [Gender], Count (*)
FROM tblPersonalData
GROUP BY [Gender]
UNION ALL
SELECT "Ethnicity", [Ethnicity], Count (*)
FROM tblPersonalData
GROUP BY [Ethnicity];
What I would like to have displayed in my REPORT should be something like:
Industry [example of VALUE counts in DB]
Communications - [7]
Conglomerate - [2]
Construction - [5]
Consulting - [12]
etc...[there are 16 total industry values]
BusinessTitle [example of VALUE counts in DB]
Advisor - [3]
CEO - [4]
CEO & President - [9]
CEO & General Counsel - [4]
etc...[there are 27 total BusinessTitle values]
Location [example of VALUE counts in DB]
Austin - [22]
Dallas/Ft Worth - [34]
etc...[there are 7 different Locations values for report]
UndergraduateDeg [example of VALUE counts in tblDegree.Degree AND tblDegree.University]
UT - [89]
Non-UT - [21]
GraduateDeg [example of VALUE counts in tblDegree.Degree AND tblDegree.University]
UT - [24]
Non-UT - [8]
A suggestion was made to use [based upon the query above]:
Control Source: TheAttrib
Control Source: TheValue
Control Source: NumOf
If I use TheAttrib for the Text-Box Control Source it returns "Industry" which is the value in the first record row of the executed query under TheAttrib
If I use TheValue for the Text-Box Control Source it returns "<BLANK>" which is the value in the first record row of the query under TheValue
If I use NumOf for the Text-Box Control Source it returns "186" which is the value in the first record row of the query under NumOf
I would have thought that since I am seeking a "CountOF" value based upon a criteria that some form of an expression in the "Control Source" of each "Text Box" would be more appropriate...
Something LIKE but not necessarily:
SELECT Count([qry_ReportData].[BusinessTitle]) AS Titles FROM qry_ReportData HAVING [qry_ReportData].[BusinessTitle] = "CEO*"
This should (I would think) return a count value of 14 based upon the below sample table data
THIS IS A SAMPLE OF QUERY RESULTS
TheAttrib TheValue NumOf
Industry 186
Industry 3 1
BusinessTitle 26
BusinessTitle Assistant Dean 1
BusinessTitle Associate VP 3
BusinessTitle Attorney At Law 1
BusinessTitle Advisory Chair 1
BusinessTitle CEO 8
BusinessTitle CEO & Chairman 5
BusinessTitle Retired 1
BusinessTitle CEO & President 6
BusinessTitle CEO-Banking 1
Location 10
Location Amarillo, TX 1
Location Argyle, TX 1
Location Austin, TX 21
Location Bellaire, TX 1
Location Blanco, TX 1
Location Bozeman, MT 1
Degree 4
Degree AB 1
Degree BA 29
Degree BBA 99
Degree BS 20
Degree Honorary MA 1
Degree Honorary PhD 4
Degree JD 13
Gender 2
Gender Female 19
Gender Male 161
Ethnicity 9
Ethnicity African Amer. 4
Ethnicity Caucasian 162
Ethnicity Hispanic 7
Please advise.
I have a single Access Report named rptDemographics I am trying to gather a variety of information into and display.
I have a quite elaborate and useful union query [with the aid of a developer I might add] that I am using as the REPORT "RECORD SOURCE"
However, the issue of displaying this information on a single Report eludes me...
The query below displays the data well enough as an executed query but to get that information in a usable form into a REPORT...
The QUERY that is used and referenced as the "Record Source" of my REPORT:
SELECT "Industry" as TheAttrib, [Industry] as TheValue, Count(*) as NumOf
FROM tblBusinessData
GROUP BY [Industry]
UNION ALL
SELECT "BusinessTitle", [BusinessTitle], Count(*)
FROM tblBusinessData
GROUP BY [BusinessTitle]
UNION ALL
SELECT "Location", [Location], Count (*)
FROM qryLocation
GROUP BY [Location]
UNION ALL
SELECT "Degree", [Degree], Count (*)
FROM tblDegree
GROUP BY [Degree]
UNION ALL
SELECT "Gender", [Gender], Count (*)
FROM tblPersonalData
GROUP BY [Gender]
UNION ALL
SELECT "Ethnicity", [Ethnicity], Count (*)
FROM tblPersonalData
GROUP BY [Ethnicity];
What I would like to have displayed in my REPORT should be something like:
Industry [example of VALUE counts in DB]
Communications - [7]
Conglomerate - [2]
Construction - [5]
Consulting - [12]
etc...[there are 16 total industry values]
BusinessTitle [example of VALUE counts in DB]
Advisor - [3]
CEO - [4]
CEO & President - [9]
CEO & General Counsel - [4]
etc...[there are 27 total BusinessTitle values]
Location [example of VALUE counts in DB]
Austin - [22]
Dallas/Ft Worth - [34]
etc...[there are 7 different Locations values for report]
UndergraduateDeg [example of VALUE counts in tblDegree.Degree AND tblDegree.University]
UT - [89]
Non-UT - [21]
GraduateDeg [example of VALUE counts in tblDegree.Degree AND tblDegree.University]
UT - [24]
Non-UT - [8]
A suggestion was made to use [based upon the query above]:
Control Source: TheAttrib
Control Source: TheValue
Control Source: NumOf
If I use TheAttrib for the Text-Box Control Source it returns "Industry" which is the value in the first record row of the executed query under TheAttrib
If I use TheValue for the Text-Box Control Source it returns "<BLANK>" which is the value in the first record row of the query under TheValue
If I use NumOf for the Text-Box Control Source it returns "186" which is the value in the first record row of the query under NumOf
I would have thought that since I am seeking a "CountOF" value based upon a criteria that some form of an expression in the "Control Source" of each "Text Box" would be more appropriate...
Something LIKE but not necessarily:
SELECT Count([qry_ReportData].[BusinessTitle]) AS Titles FROM qry_ReportData HAVING [qry_ReportData].[BusinessTitle] = "CEO*"
This should (I would think) return a count value of 14 based upon the below sample table data
THIS IS A SAMPLE OF QUERY RESULTS
TheAttrib TheValue NumOf
Industry 186
Industry 3 1
BusinessTitle 26
BusinessTitle Assistant Dean 1
BusinessTitle Associate VP 3
BusinessTitle Attorney At Law 1
BusinessTitle Advisory Chair 1
BusinessTitle CEO 8
BusinessTitle CEO & Chairman 5
BusinessTitle Retired 1
BusinessTitle CEO & President 6
BusinessTitle CEO-Banking 1
Location 10
Location Amarillo, TX 1
Location Argyle, TX 1
Location Austin, TX 21
Location Bellaire, TX 1
Location Blanco, TX 1
Location Bozeman, MT 1
Degree 4
Degree AB 1
Degree BA 29
Degree BBA 99
Degree BS 20
Degree Honorary MA 1
Degree Honorary PhD 4
Degree JD 13
Gender 2
Gender Female 19
Gender Male 161
Ethnicity 9
Ethnicity African Amer. 4
Ethnicity Caucasian 162
Ethnicity Hispanic 7
Please advise.