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

Parameter Crosstab Query - No result (form input for parameter)

Status
Not open for further replies.
Feb 6, 2006
5
GB
Hi All,

Im trying to create a crosstab query with parameter entry from a form.

I wish to be able to specify a date (using Microsoft DTPicker control) and a shift (using a combo box to the relevant table) to make the selections.

These two selections on the form are the criteria for the cross tab query which returns the downtime totals for each category for each line.

I have defined the parameters for the query by putting which seems to work for most people from what I've read, and has worked for me on previous forms in the same database (although not in parameter crosstabs....this is my 1st parameter crosstab)

However, I still get no result from the query. Without the parameters, the crosstab query works fine.

Help please...I'm really stuck. Here is the sql for the query, can anyone see anything that is obviously wrong with it?

PARAMETERS [Forms]![frmChooseDateShift]![cboShiftDatePicker] DateTime, [Forms]![frmChooseDateShift]![cboShiftPicker] Long;
TRANSFORM Sum(Downtimes.HoursLost) AS SumOfHoursLost
SELECT Downtimes.LineID, Sum(Downtimes.HoursLost) AS [Total Of HoursLost]
FROM DowntimeCategories INNER JOIN Downtimes ON (DowntimeCategories.DTCategoryID = Downtimes.DTCategoryID) AND (DowntimeCategories.DTCategoryID = Downtimes.DTCategoryID)
WHERE ((([Downtimes]![DateOccured])=[Forms]![frmChooseDateShift]![cboShiftDatePicker]) AND (([Downtimes]![ShiftID])=[Forms]![frmChooseDateShift]![cboShiftPicker]))
GROUP BY Downtimes.LineID
PIVOT DowntimeCategories.DTCategory;

Much Appreciated and thanks in advance to all!

regards

keji
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top