Hello all, I have an after insert macro that I am working on. My code looks for the month and based on the month value, it sets a value for a variable. The only trouble is, is that the value set for my variable is static and not dynamic. Here is my code:
### Code Example ###
Else if [user_info_table].[Current Date] Like "8/*/*" Then // This works great. It will find any august month with any date and year.
SetLocalVar
Name date_difference_variable
Expression DateDiff('y',[user_info_table].[Current Date],#8/31/2014#) // This is the static value that i was talking about. I want the year to change dynamically based off of the current year.
Else if [user_info_table].[Current Date] Like "9/*/*" Then // This works great. It will find any september month with any date and year.
SetLocalVar
Name date_difference_variable
Expression DateDiff('y',[user_info_table].[Current Date], 9/30/[only_the_year]) // I tried to setup a variable that does what I want but I could not get it quite right.
### Code Example ###
The function that i tried to use to create [only_the_year] with:
=DatePart("yyyy",Now())
What am I doing wrong?