Posted Wed, 19 Jan 2022 12:05:56 GMT by Thomas Henschke Jeppesen GmbH eData Analyst Level 4
Hello,
I hope someone can help me explain what I'm doing wrong or if I use the wrong function or logic.
This Monday I run a DateAdd function to get back the week number from 3 weeks ago. Instead of the expected week 01, I receive week 53 (see attached screenshot). If I use the function to get the week number 2 weeks ago I receive week 02. Does the system not know the week 01?
We currently use Automate Enterprise vs 11.6.0.70.
Thanks for every hint.

<AMVARIABLE NAME="next_rev_week">%Format(DatePart("ww", DateAdd( "ww", +0, CStr( Date() ))),"00")%</AMVARIABLE>
<AMVARIABLE NAME="rev_week" TYPE="text">%Format(DatePart("ww", DateAdd( "ww", -3, CStr( Date() ))),"00")%</AMVARIABLE>
 
Posted Wed, 29 Jun 2022 19:55:53 GMT by Amy Knode
Hi Thomas,<br> <br> Were you able to get this working or do you still need assistance? It looks like the code that you are using might be pulling the calendar week in the year rather than the week number of a particular month.<br> <br> Let us know if you still need assistance on this.&nbsp; We may need to open a case for further testing.<br> <br> Thanks,<br> <br> Amy

You must be signed in to post in this forum.