DateTimeFormat([DoB],"%Y") =
DateTimeFormat(DateTimeNow(),"%Y") or DateTimeFormat([DoB],"%Y") =
(tonumber(DateTimeFormat(DateTimeToday(),"%Y"))-1)
Hey guys I am trying to filter the DoB column based on current year and last year. I am getting an error invalid type in operator ==
Solved! Go to Solution.
@Ultralightbeam, this error has to do with data types. If you had to convert the result of DateTimeFormat to number in order to subtract 1, that probably means they're all stored as strings (if you did this based on a guess, then my conclusion isn't as solid). If this is the case, then right now you're evaluating:
string = string OR string = number
So the second expression (bold) would be your problem. I'd try converting your number back to a string. If this doesn't work, then it's probably some other combination of string/number mismatch.
Just as @clmc9601 pointed out, we need to change it back to string after the numeric calculation for the latter creteria.