hi team,
i have a date field in my data. i would need to show weekly sales. so my client wants to keep the Heading in the format "30-sep to 06 Oct" that is dd/mmm-dd/mmm format instead of showing it as WeekNumber 40.
kindly help me how can i convert the Datepart(Week,"Sales Date") to dd/mmm-dd/mmm.
Thanks a lot in advance.
6 answers
Hello Drish,
You can try below approach:
1. Week : DATENAME('week',[Order Date])
2. start date : {FIXED [Week],YEAR([Order Date]):MAX([Order Date])}
3. end date : {FIXED [Week],YEAR([Order Date]):MAX([Order Date])}
4. week format
STR(DATEPART('day',[start date])) +'-'+ LEFT(STR(DATENAME('month',[start date])),3)
+" to "+STR(DATEPART('day',[end date])) +'-'+ LEFT(STR(DATENAME('month',[end date])),3)