So far, when I scan a product, it records the current time with a Now function. What I need is to know how much time elapsed since my last scan by doing a Datediff function with the previous time recorded. My problem is that I can't manage to get the previous scan time.
I thought of two ways to do this.
1. Previous_scan = DMax("[Hours]", "Data", "Hours < Now()")
This does not work. If I change the criteria to "Hours <= Now()", it gives me the current time as if my function could not find other times recorded than the current time.
2. My second idea was to use a Dlookup and use my autonumber to look for "the current autonumber - 1" in order to get the previous time recorded. But I can't manage to create the variable in order to do this.
Anyone has any idea to solve this ? I've been working on this for 2 days already and it's getting on my nerves.
Thank you so much !
I thought of two ways to do this.
1. Previous_scan = DMax("[Hours]", "Data", "Hours < Now()")
This does not work. If I change the criteria to "Hours <= Now()", it gives me the current time as if my function could not find other times recorded than the current time.
2. My second idea was to use a Dlookup and use my autonumber to look for "the current autonumber - 1" in order to get the previous time recorded. But I can't manage to create the variable in order to do this.
Anyone has any idea to solve this ? I've been working on this for 2 days already and it's getting on my nerves.
Thank you so much !
Comment