Calculate date based off of system time

  • Thread starter Thread starter Sam
  • Start date Start date
S

Sam

Hello,

I'm trying to calculate my field (currently =Date()+1) to change a date
field on the form based off of what the current system time is.

For example, if the current time is greater than 15:00, then I need it to
show tomorrow's date. Otherwise, show the date today.

To go even more in depth, it would be great to say if the date is Friday and
it is after 11:00, show Monday's date.
 
Hello,

I'm trying to calculate my field (currently =Date()+1) to change a date
field on the form based off of what the current system time is.

For example, if the current time is greater than 15:00, then I need it to
show tomorrow's date. Otherwise, show the date today.

To go even more in depth, it would be great to say if the date is Friday and
it is after 11:00, show Monday's date.

use Time()
?Time()>#15:00#
False
 
Hello,

I'm trying to calculate my field (currently =Date()+1) to change a date
field on the form based off of what the current system time is.

For example, if the current time is greater than 15:00, then I need it to
show tomorrow's date. Otherwise, show the date today.

To go even more in depth, it would be great to say if the date is Friday and
it is after 11:00, show Monday's date.

oh, missed a piece
?weekday(date())
6 (or vbFriday)
 
Try this --

IIf(Weekday(Date())=4,Date()+3,IIf(Val(TimeValue(Now()))>=15,Date()+1,Date()))

I am sure there are simpler ways than Val(TimeValue(Now()))>=15 but this
works.
 
Try this --

IIf(Weekday(Date())=4,Date()+3,IIf(Val(TimeValue(Now()))>=15,Date()+1,Date()))

I am sure there are simpler ways than Val(TimeValue(Now()))>=15 but this
works.

Hour(Time()) >= 15 or Hour(Now()) >= 15 or just

Time() >= #15:00#
 
Back
Top