Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I want to make a date variable which stores another date variable -1 year.
The first date variable is a flexible one which the end users can fill in by them self. Then i want to make another variable which stores the date that the end user fills in -1 year.
So for example: the end user fills in 29-8-2019. The new variable needs to take that date -1 year which will result in 29-8-2018. Does anyone have an idea how I can achieve this?
Sincerely,
Rick
change this to
Aanmaakdatum = {"<=$(=Date(AddYears(Date#(vInput,'DD-M-YYYY'),-1),'DD-M-YYYY'))"}
Try below expression vInput is the variable for input
=Date(AddYears(Date#(vInput,'DD-M-YYYY'),-1),'DD-M-YYYY')
You can call the existing variable and use AddYears.
For example you have a variable vVar1 which takes the input date from the user then you can create a second variable as vVar2 = AddYears(vVar1, -1).
Hello, thanks for the reply. I am using the second variable as a filter within a set expression.
It should look something like this
sum(
{$<
Status -={'Canceled'},
Aanmaakdatum = {"<=$(vDateInput-1)"}
>}
[Kontr-afspr])
Where the vDateInput-1 is based on the original vDateInput.
Don't understand the calling a existing variable by addyears. I am trying this but it shows the original variable as a field not a variable. See below:
change this to
Aanmaakdatum = {"<=$(=Date(AddYears(Date#(vInput,'DD-M-YYYY'),-1),'DD-M-YYYY'))"}
Thank you sir, works like a charm! 🙂
No Problem