Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Variable month and Year on Crosstab

Status
Not open for further replies.

ThinWhiteDude

Technical User
Sep 21, 2004
97
0
0
US
I have a crosstab query that produces a breakdown of the current month's injury reports by department. I would like to have the user be able to pick a different month and different year from an unbound form (which uses Calendar controls to let them pick dates) and am having some trouble figuring out how to get those parameters into the report that is based on the query.

This crosstab has been built using the query builder in Access 2003, and not by me writing the SQL.

Any help you can give me will be greatly appreciated and I will be happy to answer any questions if I've been too vague.

Thanks,
TWD
 
For crosstabs, you need parameters. For example:

[tt][blue]PARAMETERS Forms!frmForm!SDate DateTime;[/blue]
TRANSFORM Count(Members.ID) AS CountOfID
SELECT Members.Code, Count(Members.ID) AS [Total Of ID]
FROM Members
WHERE (((Members.Date)=[blue][Forms]![frmForm]![SDate][/blue]))
GROUP BY Members.Code
PIVOT Members.Date;[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top