Dynamic year in a dateTime function.

0
Hi, I want to set a dynamic year in a dateTime function but it appears this error.
asked
1 answers
0

You cannot use variables or functions as parameters for dateTime, only hardcoded “literal” integers. You can use parseDateTime to create a date with variables:

parseDateTime('yyyy', formatDateTime([%CurrentDateTime%], 'yyyy'))

Also, if you’re just looking to create 01-01-currentyear, you can just do

trimToYears([%CurrentDateTime%])

 

answered