Hi Edmund,
Why don't you bundle the dates?
Here is one way you can do it.
This works because the numeric value of 201301 to 201312 will never be in the same numeric range of 201201 to 201212 and so on so forth.
I have 4 parameters
StartingYear - String
StartingPeriod - String
EndingYear - String
EndingPeriod- String
Create a formula:
BundledDates
tonumber(trim(toText({Command.YEAR},"####"))+replace(toText({Command.MONTH},"##")," ","0"))
In the record selection formula I entered:
{@BundledDates} in tonumber({?StartingYear}+if len({?StartingPeriod})=1 then "0" else ""+{?StartingPeriod})
to tonumber({?EndingYear}+if len({?EndingPeriod})=1 then "0" else ""+{?EndingPeriod})