Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi
I am trying to use the following if statement:
If(CalendarMonthAndYear < 'Nov-2009', 'Use sub-cat', 'use FOP').
The CalendarMonthandYear range is developed using the MasterCalendar approach.
When selecting dates in any format (a list box for testing purposes) I get incorrect results - e.g. if I select May-2010, the result is 'Use sub-cat', where it should be 'use FOP'.
Similar errors when selecting other dates.
What is the correct syntax to correctly select all dates before Nov-2009 for a specific action, and everything from Nov-2009 onward for another?
Hi there,
the issue with your code is that you compare against a string. May-2010 is 'smaller' than Nov-2009 because the letter M comes before N in the alphabet. You should really compare dates against dates.
So you should convert calendarMonthandYear to a date and then compare against a date, eg
date(Field, format) < '01.11.2009' [or whatever your default date format is]
Regards, Lukas
Hi there,
the issue with your code is that you compare against a string. May-2010 is 'smaller' than Nov-2009 because the letter M comes before N in the alphabet. You should really compare dates against dates.
So you should convert calendarMonthandYear to a date and then compare against a date, eg
date(Field, format) < '01.11.2009' [or whatever your default date format is]
Regards, Lukas
Thanks Lucas, the string was exactly my problem