I have a report that runs off of a query. The report is supposed to show the items that are currently withdrawn. I had an issue with it showing every time an item had been withdrawn, even though it had been returned. So I grouped the date by max. This solves the issue if the item had only ever been withdrawn by one person. However if more than one person over 'history' has removed the item it shows the last date (max) that the item was withdrawn under that persons ID.
I just need it to show what is current. I have tried to make it so that if the order date is greater than the return date it won't show, but that didn't work and I went all crosseyed trying to figure it out. So...help?!?! I'm now using Access for MS Office Professional 2003.
Here is the code:
I just need it to show what is current. I have tried to make it so that if the order date is greater than the return date it won't show, but that didn't work and I went all crosseyed trying to figure it out. So...help?!?! I'm now using Access for MS Office Professional 2003.
Here is the code:
Code:
SELECT tblOrder.GID, tblEmployee.EmployeeFirst, tblEmployee.EmployeeLast, Max(tblOrder.OrderDate) AS MaxOfOrderDate, tblOrder.Supervisor, tblItemSpecifics.Description, tblItemSpecifics.Serial_Number FROM ((tblEmployee INNER JOIN tblOrder ON tblEmployee.GlobalID = tblOrder.GID) INNER JOIN tblReturn ON tblEmployee.GlobalID = tblReturn.GID) INNER JOIN (tblItemSpecifics INNER JOIN tblOrderInfo ON tblItemSpecifics.Serial_Number = tblOrderInfo.Serial_Number) ON tblOrder.OrderNumber = tblOrderInfo.Order_Number WHERE (((tblItemSpecifics.Removed)=True)) GROUP BY tblOrder.GID, tblEmployee.EmployeeFirst, tblEmployee.EmployeeLast, tblOrder.Supervisor, tblItemSpecifics.Description, tblItemSpecifics.Serial_Number;
Comment