Click here to Skip to main content
15,923,083 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All

I want to get number of days in a particular month in sql server 2005 .Actually i want to prepare salary for employees in particular month..i have month and year
how to get count of days in a particular month using month and year

Thanks In Advance
Posted
Comments
Sandeep Mewara 20-Jun-11 6:53am    
Tried anything?

SELECT COUNT(month) FROM table_name where month='"+calender1.selectedmonth+"' and year='"+calender1.selectedyear+"'
 
Share this answer
 
Comments
Maciej Los 21-Jun-11 12:28pm    
COUNT need GROUP or HAVING clause, 'coz it's an aggregate function.
 
Share this answer
 
Comments
Maciej Los 21-Jun-11 12:31pm    
Good answer - 5!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900