matakulous
MIS
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
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