A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Setting Up & Running Reports
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Crosstab Report



 
 
Thread Tools Display Modes
  #1  
Old May 10th, 2010, 07:28 PM posted to microsoft.public.access.reports
gngsquared[_2_]
external usenet poster
 
Posts: 1
Default Crosstab Report

I searched, and tried to utilize the answers I found, but I don’t have the
skills to make them work.

I have the crosstab query shown below which works fine when the results are
in datasheet view:

TRANSFORM Max(DetailTbl.DetailID) AS MaxOfDetailID
SELECT EmpTbl.EmpNo, EmpTbl.Lname, EmpTbl.Fname
FROM TrainDocTbl INNER JOIN (EmpTbl INNER JOIN DetailTbl ON EmpTbl.EmpID =
DetailTbl.EmpID) ON TrainDocTbl.TrainDocID = DetailTbl.TrainDocID
WHERE (((TrainDocTbl.SelectRec)=On) AND ((EmpTbl.TermDate) Is Null))
GROUP BY DetailTbl.EmpID, EmpTbl.EmpNo, EmpTbl.Lname, EmpTbl.Fname
ORDER BY EmpTbl.Lname, EmpTbl.Fname, TrainDocTbl.TrainDocName
PIVOT TrainDocTbl.TrainDocName;

[SelectRec] is a Y/N field. There is a form with a listbox that allows the
user to check which qualifications meet the customer’s needs and then the
query runs to provide the results. There are currently 15 qualifications to
choose from, but I’m sure this number will expand as time goes on.

The required qualifications may change and the report needs to change the
column headings to reflect this and that is the problem. If I design the
report for qualifications A, B, and C when the user asks for E, H, and J the
report gags.

Additionally, I have formatted the text box on the report to show either YES
or – by using the following expression: =IIf([fieldname] Is Not Null,"YES","--
")

Although this works, I’m sure there is a better way of doing it.
HELP!

  #2  
Old May 10th, 2010, 08:43 PM posted to microsoft.public.access.reports
Duane Hookom
external usenet poster
 
Posts: 7,177
Default Crosstab Report

There is a solution for dynamic crosstab reporting at
http://www.rogersaccesslibrary.com/f...b_topic11.html. This
solution basically creates an alias for each of the column heading values and
transforms them into A, B, C, D, E, ...

If your TrainDocName values are fairly static and limited, you might get by
with setting the Column Headings property of the crosstab query.

--
Duane Hookom
Microsoft Access MVP


"gngsquared" wrote:

I searched, and tried to utilize the answers I found, but I don’t have the
skills to make them work.

I have the crosstab query shown below which works fine when the results are
in datasheet view:

TRANSFORM Max(DetailTbl.DetailID) AS MaxOfDetailID
SELECT EmpTbl.EmpNo, EmpTbl.Lname, EmpTbl.Fname
FROM TrainDocTbl INNER JOIN (EmpTbl INNER JOIN DetailTbl ON EmpTbl.EmpID =
DetailTbl.EmpID) ON TrainDocTbl.TrainDocID = DetailTbl.TrainDocID
WHERE (((TrainDocTbl.SelectRec)=On) AND ((EmpTbl.TermDate) Is Null))
GROUP BY DetailTbl.EmpID, EmpTbl.EmpNo, EmpTbl.Lname, EmpTbl.Fname
ORDER BY EmpTbl.Lname, EmpTbl.Fname, TrainDocTbl.TrainDocName
PIVOT TrainDocTbl.TrainDocName;

[SelectRec] is a Y/N field. There is a form with a listbox that allows the
user to check which qualifications meet the customer’s needs and then the
query runs to provide the results. There are currently 15 qualifications to
choose from, but I’m sure this number will expand as time goes on.

The required qualifications may change and the report needs to change the
column headings to reflect this and that is the problem. If I design the
report for qualifications A, B, and C when the user asks for E, H, and J the
report gags.

Additionally, I have formatted the text box on the report to show either YES
or – by using the following expression: =IIf([fieldname] Is Not Null,"YES","--
")

Although this works, I’m sure there is a better way of doing it.
HELP!

.

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 11:59 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.