desertbird
New member
- Local time
- Today, 01:08
- Joined
- Sep 22, 2022
- Messages
- 6
Hello All,
I am having trouble with a query where I want to calculate the number of days between dates where I have a UserID, JOB, and Date.
To do that all I need is the previous Date "PrevDate" each UserID was in a JOB.
I do not have any issues writing a DMax to do this when I only have one UserID in one JOB. I really got lost on what to add to the DMax criteria when I expanded my Data to all my UserIDs working all JOBs.
I really appreciate any help in my DMax function that will show "PrevDate" from the Data example below. Not too concerned about how to get "ElpsDays".
Here is the DMax function that works when I only had one UserID and one JOB: DMax("Date","Data","Date<#" & [Date] & "#")
Here is what my Data looks like with the desired result in the "PrevDate" column:
Thank you in advance!!!!
I am having trouble with a query where I want to calculate the number of days between dates where I have a UserID, JOB, and Date.
To do that all I need is the previous Date "PrevDate" each UserID was in a JOB.
I do not have any issues writing a DMax to do this when I only have one UserID in one JOB. I really got lost on what to add to the DMax criteria when I expanded my Data to all my UserIDs working all JOBs.
I really appreciate any help in my DMax function that will show "PrevDate" from the Data example below. Not too concerned about how to get "ElpsDays".
Here is the DMax function that works when I only had one UserID and one JOB: DMax("Date","Data","Date<#" & [Date] & "#")
Here is what my Data looks like with the desired result in the "PrevDate" column:
UserID | JOB | Date | PrevDate | ElpsDays |
argrol | RECEIVING DOMESTIC | 5/10/2022 | ||
argrol | RECEIVING DOMESTIC | 5/16/2022 | 5/10/2022 | 6 |
argrol | RECEIVING DOMESTIC | 5/18/2022 | 5/16/2022 | 2 |
argrol | RECEIVING DOMESTIC | 5/19/2022 | 5/18/2022 | 1 |
argrol | RECEIVING DOMESTIC | 5/25/2022 | 5/19/2022 | 6 |
argrol | RECEIVING IMPORT | 5/26/2022 | ||
argrol | RECEIVING IMPORT | 5/29/2022 | 5/26/2022 | 3 |
argrol | RECEIVING IMPORT | 5/31/2022 | 5/29/2022 | 2 |
allenjaq | PICKING MODULE | 5/9/2022 | ||
allenjaq | PICKING MODULE | 5/10/2022 | 5/9/2022 | 1 |
allenjaq | PICKING MODULE | 5/20/2022 | 5/10/2022 | 10 |
allenjaq | PICKING MODULE | 5/21/2022 | 5/20/2022 | 1 |
allenjaq | PICKING MODULE | 5/22/2022 | 5/21/2022 | 1 |
allenjaq | PICKING MODULE | 5/25/2022 | 5/22/2022 | 3 |
Thank you in advance!!!!