I have a report named "rptHOTSTICKS_E XPIRING" based on a query named "HOSTICKS_SHIPP ING_REPORT Query". The query contains these fields:
ORDER_NUM (text)
CUST_NUM (text)
Name, address, contact info, I think not important to this thread
DATE_SHIP (date)
Then I have a field
with criteria
where [FromDate] and [To Date] are parameters.
My report is to let me know when sticks are coming up that are 2 years old or more. However, if I have already shipped a new order (say like last week) I want to exclude it from my report. For example, I have a customer with sticks expiring 12/10/09, but I shipped him a new order 11/4/09. Currently he appears on my report but I do not want him to. (The report is to alert me of upcoming orders to fill, and his won't be one because it's already filled!) I thought I could use DMax to help me out here, but I don't know how to limit it to each customer number in the report. Right now the result gives me the max ship date in the entire table and reports that date for every result of the query. I thought I could use criteria on the DMax result, perhaps if LAST_SHIPMENT and DATE_SHIP are equal, then put them on the report.
Here is how I'm trying to use the DMax command in my query. (I'm not saying it's correct, but I tried.) (HOTSTICKS_ORDE RS is a table name. I didn't learn good naming practices in time for this one.)
I hoped since the query was based on CUST_NUM it would do DMax for each customer. I also tried putting [CUST_NUM] on the end of that DMax argument but that didn't work either. Could anyone offer me any pointers?
As always, if I'm not clear, please let me know. Thanks in advance!!!!!!
ORDER_NUM (text)
CUST_NUM (text)
Name, address, contact info, I think not important to this thread
DATE_SHIP (date)
Then I have a field
Code:
STICKS_EXPIRE: DateAdd("yyyy",2,[DATE_SHIP])
Code:
Between [From Date] And [To Date]
My report is to let me know when sticks are coming up that are 2 years old or more. However, if I have already shipped a new order (say like last week) I want to exclude it from my report. For example, I have a customer with sticks expiring 12/10/09, but I shipped him a new order 11/4/09. Currently he appears on my report but I do not want him to. (The report is to alert me of upcoming orders to fill, and his won't be one because it's already filled!) I thought I could use DMax to help me out here, but I don't know how to limit it to each customer number in the report. Right now the result gives me the max ship date in the entire table and reports that date for every result of the query. I thought I could use criteria on the DMax result, perhaps if LAST_SHIPMENT and DATE_SHIP are equal, then put them on the report.
Here is how I'm trying to use the DMax command in my query. (I'm not saying it's correct, but I tried.) (HOTSTICKS_ORDE RS is a table name. I didn't learn good naming practices in time for this one.)
Code:
LAST_SHIPMENT: DMax("[DATE_SHIP]","HOTSTICK_ORDERS")
As always, if I'm not clear, please let me know. Thanks in advance!!!!!!
Comment