Hello,
I am using reporting 2008. Here is our formulas:
datepart (month, date_of_birth) * 100 + datepart (day, date_of_birth)
between (@tb_StartBirthMonth * 100) + @tb_StartBirthDay
and (@tb_EndBirthMonth * 100) + @tb_EndBirthDay.
This formulas works fine if people entering dates in this order from Jan thru December. For example, if my birth date is December 5th using the following parameters:
@tb_StartBirthMonth: 12
@tb_StartBirthDay: 2
@tb_EndBirthMonth: 12
@tb_EndBirthDay:15
Since my birth date is in the range entered, it will return mine birth date using the above formulas. That is (12*100) + 5 between (12*100) + 2 and (12*100 )+ 15.
1205 between 1202 and 1215 ? YES.
However, the problem arise if people entering parameters in this order for example:
@tb_StartBirthMonth: 12
@tb_StartBirthDay: 2
@tb_EndBirthMonth: 1
@tb_EndBirthDay:31
This is because they want to see a list of people with birth date in December + those will be in Januray of next year for example. My above formulas is no longer working. It does not return my birth date even though it is in the range entered.
That is (12*100) + 5 between (12*100) + 2 and (1*100 )+ 31
1205 between 1202 and 131 ? NO.
Instead of asking people to run one for December and another for January, is there away I can fix the formulas where it can compute either ways? Any help to can provide is greatly appreciated. I will try to shorten my future questions next time. Sorry
I am using reporting 2008. Here is our formulas:
datepart (month, date_of_birth) * 100 + datepart (day, date_of_birth)
between (@tb_StartBirthMonth * 100) + @tb_StartBirthDay
and (@tb_EndBirthMonth * 100) + @tb_EndBirthDay.
This formulas works fine if people entering dates in this order from Jan thru December. For example, if my birth date is December 5th using the following parameters:
@tb_StartBirthMonth: 12
@tb_StartBirthDay: 2
@tb_EndBirthMonth: 12
@tb_EndBirthDay:15
Since my birth date is in the range entered, it will return mine birth date using the above formulas. That is (12*100) + 5 between (12*100) + 2 and (12*100 )+ 15.
1205 between 1202 and 1215 ? YES.
However, the problem arise if people entering parameters in this order for example:
@tb_StartBirthMonth: 12
@tb_StartBirthDay: 2
@tb_EndBirthMonth: 1
@tb_EndBirthDay:31
This is because they want to see a list of people with birth date in December + those will be in Januray of next year for example. My above formulas is no longer working. It does not return my birth date even though it is in the range entered.
That is (12*100) + 5 between (12*100) + 2 and (1*100 )+ 31
1205 between 1202 and 131 ? NO.
Instead of asking people to run one for December and another for January, is there away I can fix the formulas where it can compute either ways? Any help to can provide is greatly appreciated. I will try to shorten my future questions next time. Sorry