Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
Im trying to create something in the script that translates a yyyy-mm-dd day format to give me a weeknum, ideally year then number. So yyyy-01, yyyy-02 etc etc..
Thanks Paul
Hi, Try this:
Year(Date)&'-'&Week(Date)
Weekyear(date#(YourField,'YYYY-MM-DD'))&-&Week(date#(YourField,'YYYY-MM-DD'))
Try with WeekYear(myDate) & '-' & Num(Week(myDate),'00')
let me know
Hi ..
This a example:
=Year(date('2015-06-01','YYYY-MM-DD'))&'-'&Week(date('2015-06-01','YYYY-MM-DD'))
output
2015-23
=Year(date(fieldDate,'YYYY-MM-DD'))&'-'&Week(date(fiedDate,'YYYY-MM-DD'))
Brilliant, saved me a world of hassle!
Take a look at my answer:
WeekYear takes the year in wich the week follows so it is the correct year because for some dates you could have wrong year week combinations.
Second I put Num(...) formatted with two digits '00' in this way your output will Always have the same lenght, otherways you will have
20151
20152
201511
and so on