I have the table Seasons:
YEAR DATE_FROM DATE_TO
2013 2013-04-21 2013-11-14
2014 2014-04-03 2014-12-03
I need a query that gets as parameters the @year,@month,@type and it returns for
@type=
1)the days that are contained within the period for the @month of the @year
2)the days that have passes since the beginning of the period and until the end of the @month of the @year
Examples:
@type=1, @month= 5, @year = 2013 should returns 31 days
@type=2, @month= 5, @year = 2013 should returns 40 days
Thanx in advance!