3239
Technical User
- May 14, 2003
- 64
Hello everyone.
I am having a problem figuring out why my query is returning incorrect results. I have a form that accepts a date range from the user and passes the values from the text boxes on the form to the query. Sometimes the query returns the correct results but in some cases incorrect dates are returned. Is it some tricky thing Access have going on with dates being passed from a form to a query? Please help! My code is below.
Thanks
I am having a problem figuring out why my query is returning incorrect results. I have a form that accepts a date range from the user and passes the values from the text boxes on the form to the query. Sometimes the query returns the correct results but in some cases incorrect dates are returned. Is it some tricky thing Access have going on with dates being passed from a form to a query? Please help! My code is below.
Thanks
Code:
[b]SELECT[/b] Requisition.RequisitionNumber, PurchaseOrder.POID, Requisition.SupplierName, PurchaseOrder.Date, RequisitionLineItems.BudgetUnit, RequisitionLineItems.POChartOfAccount, RequisitionLineItems.UnitPrice, RequisitionLineItems.UnitsOrdered
[b]FROM[/b] (PurchaseOrder [b]INNER JOIN[/b] Requisition [b]ON[/b] PurchaseOrder.POID = Requisition.POID) [b]INNER JOIN[/b] RequisitionLineItems [b]ON[/b] Requisition.RequisitionNumber = RequisitionLineItems.RequisitionNumber [b]IN[/b] '\\Svr-fp-rh3\groups\Purchasing Tracking Database Systems\IS Procurement Test\IS Procurement Project Test_be.mdb'
[b]WHERE[/b] (((Requisition.SupplierName) Like "*" & [Forms]![POSearch]![Search3] & "*") [b]AND[/b] ((PurchaseOrder.Date) Is Not Null And (PurchaseOrder.Date) [b]Between[/b] [Forms]![POSearch]![Beginning Order Date] [b]And[/b] [Forms]![POSearch]![Ending Order Date]) [b]AND[/b] ((RequisitionLineItems.BudgetUnit) Like "*" & [Forms]![POSearch]![Search2] & "*") [b]AND[/b] ((RequisitionLineItems.POChartOfAccount) Like "*" & [Forms]![POSearch]![Search4] & "*"));