Check to see if 72 hours

bash

New member
Local time
Today, 14:16
Joined
Oct 15, 2007
Messages
8
I have an access table, and there is a field called user_time. Once a user record has been inserted, it puts a timestamp on this field, to record the date/time the record was saved to the database.

Now I need to write a query to check if it has been 72 hours since the insertion of the user into the database. This will exclude weekends.
If a record was inserted on a Friday, on Monday it will not be 72 hours, as weekends are not taken into account only weekdays. So Monday will only be 24 hours since the user was added.

Please can you help me with this.
 
Essentially the only entries affected by the weekend hours are those entered on Wednesday, Thursday or Friday so the following should provide what you need.

Use the following where clause
WHERE (((((Now()-[user_time])*24)-(IIf(Format([user_time],"ddd") In ('Wed','Thu','Fri'),48,0)))>=72))
or
WHERE (((DateDiff("h",[user_time],Now())-(IIf(Format([user_time],"ddd") In ('Wed','Thu','Fri'),48,0)))>=72))

NBThis assumes that once a week is gone by you don't care about the other weekends that will be included, i.e. it only removes one weekend
 

Users who are viewing this thread

Back
Top Bottom