My database table Holiday includes field ad Holidaydate->datetime , WeekendHoliday->bit, PublicHoliday->bit
I want the nos of weekendholiday and also publicholiday in a specific month year.
My table values are as(example)
Holidaydate WeekendHoliday PublicHoliday
----------- -------------- -------------
4/02/2012 true false
4/20/2012 true false
5/3/2012 true False
5/30/2012 false true
4/05/2013 false true
So now output should be like this:
year Month count(weekend) count(public)
---- ----- -------------- -------------
2012 April 2 0
2012 May 1 1
2013 April 0 1
I don’t have SQL server available. THis is tested on mysql. Here year and month are function to return the year and month of date. Syntax of CASE should be same across database.