Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi
I have 2 variables vStart and vEnd, i need to give an expression so that i display Last week and This Week,Week should start on Sunday , When i click on This Week button , Date value should set such that , vStart = Sunday of this week adn vEnd = today
2Button :
Last Week :
vStart = Sunday of last Week
vEnd = Saturday of Last Week.
Can any body please help me in writing the expression for the above.
This week:
vStart = weekstart(today(),0,-1)
vEnd = today()
Last week:
vStart = weekstart(today(),-1,-1)
vEnd = weekend(today(),-1,-1)
try something like this:
vEnd=today() // for current week
vStart=Date(Num(today()) - weekday(today())) // for current week Sunday
OR, Date(Num(today()) - weekday(today()) - 1) // i don't remeber what is the weekday value for sunday, so may be this -1 adjusment be required. just try both of them which works.
implement the same logic for last week with concept Week=week-1;
Regards, tresesco
Thank you , i able to get this week by using the expression for
vStart = =Date(Num(today()) - weekday(today()) - 1)
vEnd = today()
But by replacing Today() by Week - 1 did not work , could any body please help me in getting the revious week , previous week should start from Sunday of last week
and End on Sat of Last Week.
Please Help...
This week:
vStart = weekstart(today(),0,-1)
vEnd = today()
Last week:
vStart = weekstart(today(),-1,-1)
vEnd = weekend(today(),-1,-1)