Click here to Skip to main content
15,902,189 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
I am new to this site.

Can anyone explain me how to select start and end date of a month, for any year, without using calendar in asp.net?
Posted
Updated 8-May-11 21:28pm
v2
Comments
Dalek Dave 9-May-11 3:29am    
Edited for Spelling and Readability.

 
Share this answer
 
Comments
Dalek Dave 9-May-11 3:29am    
Yep!
Start date is always 1st

For the last date of any month, take the 1st of next month and deduct one day.
 
Share this answer
 
Comments
Dalek Dave 9-May-11 3:29am    
And the award for pointing out the bleeding obvious goes to...
:) Well done.
Kim Togo 9-May-11 3:50am    
Good thinking :-), my 5.
I have done this in Database,-

DAY(DATEADD(s, - 1, DATEADD(mm, DATEDIFF(m, 0, DatetimeField) + 1, 0)))


Hope this can help you.
 
Share this answer
 

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