cancel
Showing results for 
Search instead for 
Did you mean: 

Select Expert: Month and Year two different fields, need suggestion

Former Member
0 Kudos

This may be very simple, but I'm having a total brainfart today so here I am...

I have two fields, one is a MONTH field which is obviously a 1 to 2 digit number field, and a YEAR field; a 4 digit number field.

I have 4 parameters that will utilize the MONTH and YEAR fields as a selection criteria. Two paramters are for Start-Month and Start-Year, and the other two; End-Month and End-Year.

Basically, I want users to be able to select everything between the Starts and the Ends.

The problem is, for example, if I put in the criteria as starting 02 (Feb) as Start-Month, 2007 as Start-Year, and 11 (Nov) as End-Month, 2008 as End-Year, it will select everything between February 2007 - December 2007, then February 2008 - November 2008. The problem lies in the fact that it will skip January 2008 since, technically, it is not defined according to my Select Expert.

I'm pretty sure this is a simple solution to get the range I want but I just can't think today for some reason.

Any suggestions?

Currently

({table.MONTH} >= {?Start-Month} and {table.YEAR} >= {?Start-Year}) and
({table.MONTH} <= {?End-Month} and {table.YEAR} <= {?End-Year})

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Try this

({table.MONTH} >= {?Start-Month} and {table.YEAR} >= {?Start-Year}) or
({table.MONTH} <= {?End-Month} and {table.YEAR} <= {?End-Year})

Regards,

Raghavendra

Former Member
0 Kudos

Hello.

Unfortunately, changing to OR seems to encompass all records instead.

Former Member
0 Kudos

Sorry this should work

({table.MONTH} >= {?Start-Month} and {table.YEAR} = {?Start-Year}) or

({table.MONTH} <= {?End-Month} and {table.YEAR}= {?End-Year})

Regards,

Raghavendra

Answers (1)

Answers (1)

Former Member
0 Kudos

Thank you. I knew it was some simple logic I missed. It'll work for now for a 2 year period but I'll worry about when we get to more than 2 year data.

Thanks again.