Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need help creating an expression that identifies the last week day or Saturday of the month

Status
Not open for further replies.

MacroScope

Programmer
Jul 17, 2010
286
US
I have an operation that I'd like to carry out on user login on the last weekday or Saturday before the end of the month. Assume the 1st is on Sunday or Monday, the expression would evaluate as true on Saturday, and if the 1st is on, say, Tuesday, then it would evaluate as true on Monday.

I don't have any problems with making the desired operations work, but I'm having a bit of an issue writing the expression that fires it.

As always, all assistance is appreciated.
 
Actually, I think I got it. I believe IIf(Weekday(Date())=7 And (Format(Date()+1,"d")=1 Or Format(Date()+2,"d")=1),True,IIf(Weekday(Date())<>1 And Format(Date()+1,"d")=1,True,False)) will return True or False on the desired days.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top