Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Expert,
I want to create two variables in my qvw .where vStartDate must be start date of financial year and end date must be last date of that fin year.i want to automate this two variable .Means next year they must change.
For e.g
Let vStartDate=Makedate(2016,04,01);// next year 01/04/2017
Let vEndDate=Makedate(2017,03,31);//31,03,2018
Please help me
Regards,
Rupali
LET vYear = year(today());
Let vStartDate=Makedate('$(vYear)',04,01);// next year 01/04/2017
Let vEndDate=Makedate('$(vYear)',03,31);//31,03,2018
You mean, you want the script to figure out whether we're in the current or in the next fiscal year?
Something like this?
Let vStartDate = Makedate(IF (Month(Today())<4,Year(Today())-1,Year(Today())),4,1);
Let vEndDate = Makedate(IF (Month(Today())<4,Year(Today()),Year(Today())+1),3,31);
Best,
Peter;
Thank you!
but i was trying like this.
vStartDate=Date(Makedate(Left(Yearname(Date(Today(),'DD/MM/YYYY'),0,4),4),04,01),'DD-MMM-YYYY')
You can also use Rakesh's technique, but with one correction:
Let vTodaysYear = Year(Today());
Let vStartDate = Makedate(IF (Month(Today())<4,vTodaysYear-1,vTodaysYear),4,1);
Let vEndDate = Makedate(IF (Month(Today())<4,vTodaysYear,vTodaysYear+1),3,31);
Best,
Peter
Do you think that's more readable?