Pivot on weekday

Experts,
The query belows works but needs some help. I need this such that I can generate a report that prints M - F across the top and places the control OnTimeScrap under the appropriate day. I've tried transform and pivot but I could never gert the syntex correct, if it is even the right way to go.

SELECT tblSupervisorReporting.ProductionDate, tblLineSupervisors.SurpevisorLN, tblLineCode.LineCodeDescription, tblLineSupervisors.Shift, tblSupervisorReporting.OnTimeScrap
FROM tblShift INNER JOIN (tblLineCode INNER JOIN (tblLineSupervisors INNER JOIN tblSupervisorReporting ON tblLineSupervisors.SupervisorID = tblSupervisorReporting.SupervisorID) ON tblLineCode.LineCodeID = tblLineSupervisors.LineCodeID) ON tblShift.ShiftID = tblLineSupervisors.Shift
WHERE (((tblSupervisorReporting.ProductionDate) Between [Enter Beginning Date] And [Enter Ending Date]) AND ((tblLineSupervisors.Active)=Yes));
Frank FreeseAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Patrick MatthewsCommented:
SELECT Format(tblSupervisorReporting.ProductionDate, "ddd") AS Wkday, tblLineSupervisors.SurpevisorLN, tblLineCode.LineCodeDescription, tblLineSupervisors.Shift, tblSupervisorReporting.OnTimeScrap
0
Frank FreeseAuthor Commented:
How do I incorporate this into my query?
0
Patrick MatthewsCommented:
Use that new SELECT clause instead of the old one, and then use the Crosstab Wizard to build a corsstab
based on that query you just made.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Frank FreeseAuthor Commented:
I replaced my Select statement with yours as follows:

SELECT Format(tblSupervisorReporting.ProductionDate, "ddd") AS Wkday, tblLineSupervisors.SurpevisorLN, tblLineCode.LineCodeDescription, tblLineSupervisors.Shift, tblSupervisorReporting.OnTimeScrap
FROM tblShift INNER JOIN (tblLineCode INNER JOIN (tblLineSupervisors INNER JOIN tblSupervisorReporting ON tblLineSupervisors.SupervisorID = tblSupervisorReporting.SupervisorID) ON tblLineCode.LineCodeID = tblLineSupervisors.LineCodeID) ON tblShift.ShiftID = tblLineSupervisors.Shift
WHERE (((tblSupervisorReporting.ProductionDate) Between [Enter Beginning Date] And [Enter Ending Date]) AND ((tblLineSupervisors.Active)=Yes));

I t worked.

I then created a cross tab query using the above query:

TRANSFORM Count(qryByDateOnTimeSupervisors.OnTimeScrap) AS CountOfOnTimeScrap
SELECT qryByDateOnTimeSupervisors.SurpevisorLN, qryByDateOnTimeSupervisors.LineCodeDescription, qryByDateOnTimeSupervisors.Shift
FROM qryByDateOnTimeSupervisors
GROUP BY qryByDateOnTimeSupervisors.SurpevisorLN, qryByDateOnTimeSupervisors.LineCodeDescription, qryByDateOnTimeSupervisors.Shift
PIVOT qryByDateOnTimeSupervisors.Wkday;

I ran the query and received the following error:

The Microsoft Jet database engine does not recognize "Enter Beginning Date"  as a valid field name or expression".
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.