on 01-02-2015 5:18 AM
Hi Experts,
My dateformat of my field is MM.YYYY,
so in the prompt for end date i used formula
userresponse("Enter last date:") as in prompt statement
Now i want the last 3 months date
e.g; last month =12.2014
then i want 11.2014,10.2014,09.2014
Thanks.
Ashwin
Hi Ashwin,
Please follow following steps:
Create variable Month
1. Month= ToNumber(Substr(( userresponse("Enter last date:"));0;2))
**This will Give you Month Number.
2. Month-1 = If([Month] =1) Then 12 Else([Month]-1)
**This will give last month number
3. Month-2 = If([Month] =1) Then 11 ElseIf ([Month] =2) Then 12 Else ([Month]-2)
**This will give last to last month number
4. Month-3 = If([Month] =1) Then 10 ElseIf ([Month] =2) Then 11 ElseIf ([Month] =3) Then 12 Else ([Month]-3)
**This will give last to last to last month number
Similarly you can find year and later concatenate both.
Hope it helps!
Let me know if I dint get your requirement correct.
Regards
Sheetal Sharma
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ashwin,
1. Use Format number function to remove "," in Year as below:
Year = Formatnumber([Year Calculated];"####")
**This will give result as YYYY instead of Y,YYY
2. For Month
Month = Formatnumber([Month Calculated];"####")
Sufix = If(Length([Month])<2 ;0)
3. Final Formula=Concatenation([Sufix];[Month];".";[Year])
02.2015
Hope it helps!!
Regards
Sheetal Sharma
Hi Aswin ,
V_Month =userresponse("Enter last date")
Previous month
=FormatDate(RelativeDate( ToDate([V_Month];"M.yyyy");-1);"M.yyyy")
Previous to Previous
=FormatDate(RelativeDate( ToDate(FormatDate(RelativeDate( ToDate([V_Month];"M.yyyy");-1);"M.yyyy");"M.yyyy");-1);"M.yyyy")
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
89 | |
10 | |
9 | |
9 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.