I am trying to create a basic search formula to sa...
# general
m
I am trying to create a basic search formula to say whether the month on a ship date equals the current month. The formula in the photos works for YYYY and DD but refuses to work for MM. I can pull the MM information which shows it as 4. I'm thinking my formula is incorrect for the Month or maybe the formula type. Any suggestions would be appreciated.
r
You need an ELSE in your case statement also
m
ELSE is not mandatory, it will return null if the condition is not matched and there is no ELSE clause
1
a
MM returns 04 and not 4.
CASE WHEN TO_CHAR({shipdate},'YYYY-MM') = TO_CHAR(({today},'YYYY-MM') THEN 1 END
m
Thanks, @Arūnas Žindžius. That worked.