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

Crosstab queries and parameters that are not working

Status
Not open for further replies.

mmasuda

Technical User
Dec 28, 2004
35
US
I have a table “caller” which displays among other info the type of caller, the quarter of the fiscal year, and the year.
I want to run a crosstab query which displays the count of the type of caller and prompt the user to enter which fiscal year quarter and year should be queried.
The crosstab query runs fine and displays all the information. I cannot, however, convince it to ask the user for the quarter and the year. In design view, I tried to use the query > parameter option. It does ask to input the quarter and the year but still displays all the data. Any ideas?
 
Have you declared the parameters with the correct type ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
I hope so. In the table I used text for both year and quarter, so I used the same for the parameter.
 
Can you post the SQL code ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Yes. This is without parameters.
Code:
TRANSFORM Count(caller.caller_id) AS totalIntakesOfQuarter
SELECT caller.caller_type, caller.Quarter
FROM caller
GROUP BY caller.caller_type, caller.Quarter
PIVOT caller.Year;

When I use parameters it looks like this
Code:
PARAMETERS [Enter Quarter] Text ( 255 ), [Enter Year] Text ( 255 );
TRANSFORM Count(caller.caller_id) AS totalIntakesOfQuarter
SELECT caller.caller_type, caller.Quarter
FROM caller
GROUP BY caller.caller_type, caller.Quarter
PIVOT caller.Year;

thanks for helping.
 
Without a WHERE clause, it's standard behaviour to get all the records ...

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Adding the "where" worked perfectly.
Thank you very much.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top