Hi all,
I have a query that is showing order info between a start and end date that a user inputs from a form. Everything is working correctly with the CalcWorkDay module and I'm just trying to limit the results in the query.
I only want to see orders that took longer than 1 day to ship, so I added ">1" in the criteria row for my DaystoShip expression. It errors out.
DaystoShip: CalcWorkDays([Order Date],[Ship Date])
expression
Criteria: >1 - this gives me an error saying too complex.
How can I get this to work?
Here's the SQL view:
Code:
SELECT tblOutbound_Orders.[Order Number], tblOutbound_Orders.[Order Date], tblOutbound_Orders.[SEC ID], tblOutbound_Orders.[Order Priority], tblOutbound_Orders.[Ship Date], tblOutbound_Orders.Status, CalcWorkDays([Order Date],[Ship Date]) AS DaystoShip, DCount([Order Priority],"qryTotal_HP_Orders") AS TotalHPCount
FROM tblOutbound_Orders
GROUP BY tblOutbound_Orders.[Order Number], tblOutbound_Orders.[Order Date], tblOutbound_Orders.[SEC ID], tblOutbound_Orders.[Order Priority], tblOutbound_Orders.[Ship Date], tblOutbound_Orders.Status
HAVING (((tblOutbound_Orders.[Order Date]) Between [Forms]![frmShipments]![txtStartDate] And [Forms]![frmShipments]![txtEndDate]) AND ((tblOutbound_Orders.[Order Priority])<4) AND ((CalcWorkDays([Order Date],[Ship Date]))>1))
ORDER BY tblOutbound_Orders.[Order Number], tblOutbound_Orders.[Order Date];