Tony Martin Posted September 6, 2008 Posted September 6, 2008 Hi folks. I currently have a script that finds whatever it is I'm looking for - the following day - just fine using: Get( CurrentDate ) + 1 The problem is two-fold: #1 - I want it to be more intuitive, and react based on the day it is today. Since we only have data for Monday-Friday, I want it to be able to find Monday's data on Friday. This, of course, can be done by using the following command on Friday: Get( CurrentDate ) + 3 However #2 - I want it to pick the appropriate day and "+" number based on what day today is. Does this make sense? In other words, I want a case function that will recognize that if today (the day on which we are searching) is Sunday thru Thursday, it'll use "Get( CurrentDate ) + 1"; if it's Friday it'll use "Get( CurrentDate ) + 3"; if it's Saturday it'll use "Get( CurrentDate ) + 2". Here's the code I came up with, which doesn't work: Case ( DayOfWeek(//) = 6 ; Get ( CurrentDate ) + 3 ; DayOfWeek(//) = 7 ; Get ( CurrentDate ) + 2 ; Get ( CurrentDate ) + 1 ) Can someone help me fix this? Thank you so much!
Tony Martin Posted September 6, 2008 Author Posted September 6, 2008 Figured it out...here's what the corrected script code is: Case ( DayName(Get ( CurrentDate )) = "Friday" ; Get ( CurrentDate ) + 3 ; DayName(Get ( CurrentDate )) = "Saturday" ; Get ( CurrentDate ) + 2 ; Get ( CurrentDate ) + 1 )
Recommended Posts
This topic is 5924 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now