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 Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using Criteria in Crosstab Query 1

Status
Not open for further replies.

Gucci2006

Technical User
Joined
Jan 4, 2007
Messages
5
Location
US
I have a crosstab query that I would like to have the user define the criteria. When I set the criteria as stated below, I get this error message "The Microsoft Jet database engine does not recognize [Enter Current Month] as a valid field or expression"

Field: Month
Table: tbl_44900
Total: Where
Crosstab:
Criteria: [Enter Current Month]

Any assistance would be greatly appreciated
 
You need to set up parameters. Here is an example (SQL view):

Code:
[b]PARAMETERS Forms!frmForm!sdate DateTime;[/b]
TRANSFORM Count([Members].[ID]) AS CountOfID
SELECT [Members].[Code], Count([Members].[ID]) AS [Total Of ID]
FROM Members
WHERE ((([Members].[Date])=[Forms]![frmForm]![sdate]))
GROUP BY [Members].[Code]
PIVOT [Members].[Date];

You can also assign Parameters by right-clicking in the design grid or by choosing Parameters from the Query menu.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top