Skip to main content
Announcements
July 15, NEW Customer Portal: Initial launch will improve how you submit Support Cases. IMPORTANT DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

variables

How to define variable like below.


Format required: YYYYMMDD

vsomething=  today minus 40 days.   so in this case vSomething=20150215 (40 days from today)

caviat: condition where year has to be current year. In this case if this variable got executed on january 20 (where 40 days minus falls into 2014), it will default the start date to 20150101

Thanks for the help in advance.

1 Solution

Accepted Solutions
luciancotea
Specialist
Specialist

= date( if( Today()-40 < YearStart(Today()) , YearStart(Today()) , date(Today()-40) ) , 'YYYYMMDD')

View solution in original post

2 Replies
jpenuliar
Partner - Specialist III
Partner - Specialist III

vPast40Days = Date(Today() - 40, 'YYYYMMDD');

luciancotea
Specialist
Specialist

= date( if( Today()-40 < YearStart(Today()) , YearStart(Today()) , date(Today()-40) ) , 'YYYYMMDD')