Re: SQL parameter query not returning values



On 29 nov, 17:39, tbrog...@xxxxxxxxx wrote:
I have an unbound form frmProdReview with an OK command button set to
OpenQuery and a Cancel command button. On the form I have 3 controls
txtDate, cboShift, and cboDept.

When I click the "OK" button the query runs. It returns a data***
that contains no data only the field names I have requested. Below is
the SQL. Any ideas?

Thanks,

Tim

PARAMETERS forms![frmProdReview]![txtDate] Short, forms!
[frmProdReview]![cboShift] Text ( 255 ), forms![frmProdReview]!
[cboDept] Text ( 255 );
SELECT DISTINCTROW Production.ProductionDate, Department.Department,
Shift.Shift, Workstation.WorkstationName, Parts.PartID,
ProductOperation.Operator1, ProductOperation.Operator2,
ProductOperation.QuantityRun
FROM Shift INNER JOIN (((Department INNER JOIN Production ON
Department.Department=Production.Department) INNER JOIN Workstation ON
Department.Department=Workstation.Department) INNER JOIN (Parts INNER
JOIN ProductOperation ON Parts.PartID=ProductOperation.PartID) ON
(Workstation.WorkstationID=ProductOperation.WorkstationID) AND
(Production.ProductionID=ProductOperation.ProductionID)) ON
Shift.Shift=Production.Shift
WHERE (((Production.ProductionDate)=Forms!frmProdReview!txtDate));

What is the result of the query when you copy it to a query design
window (in SQL design). Of course with the parameters filled in?
.


Quantcast