How do I compute yesterday's business date if today is Monday

  • Thread starter Thread starter Dave
  • Start date Start date
D

Dave

I am computing yesterday data entries using
(DateValue([CloseStamp]))=Date()-1).

But how do I do this if today is Monday, because Friday is -3.

Thanks

dave
 
Do you need to worry about Sat and Sunday being the start date? If not,
then

DateValue([CloseStamp]) = Date() - IIF(Weekday(Date())=2,-3,-1)
 
Thanks!!!

Dave

John Spencer said:
Do you need to worry about Sat and Sunday being the start date? If not,
then

DateValue([CloseStamp]) = Date() - IIF(Weekday(Date())=2,-3,-1)


Dave said:
I am computing yesterday data entries using
(DateValue([CloseStamp]))=Date()-1).

But how do I do this if today is Monday, because Friday is -3.

Thanks

dave
 
I had to change the -3 & -1 to 3 & 1

It works great thanks

John Spencer said:
Do you need to worry about Sat and Sunday being the start date? If not,
then

DateValue([CloseStamp]) = Date() - IIF(Weekday(Date())=2,-3,-1)


Dave said:
I am computing yesterday data entries using
(DateValue([CloseStamp]))=Date()-1).

But how do I do this if today is Monday, because Friday is -3.

Thanks

dave
 
My mistake, I did two minuses. Glad you worked it out.

Dave said:
I had to change the -3 & -1 to 3 & 1

It works great thanks

John Spencer said:
Do you need to worry about Sat and Sunday being the start date? If not,
then

DateValue([CloseStamp]) = Date() - IIF(Weekday(Date())=2,-3,-1)


Dave said:
I am computing yesterday data entries using
(DateValue([CloseStamp]))=Date()-1).

But how do I do this if today is Monday, because Friday is -3.

Thanks

dave
 
Back
Top