Click here to Skip to main content
15,885,244 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
i want to calculate the first date of every month using sql server


Rgds,
Narasiman P.
Posted
Comments
jaideepsinh 3-Jul-13 8:21am    
Can you explain in brief you question.
CHill60 3-Jul-13 8:40am    
Do you want to use T-SQL or C# ... retag your question appropriately

C#:
C#
DateTime firstday = new DateTime(Year,Month, 1);

SQL:

SQL SERVER – Query to Find First and Last Day of Current Month
[^]

Regards.. :laugh:
 
Share this answer
 
v3
Adding this solution as the OP used the phrase
Quote:
of every month
Have a look at this post to generate a list of months[^]. You can then feed that into the link provided by Rohan Leuva in Solution 1 above.

In C# have a look at this link for getting an array of months[^]. Again - feed each month into solution 1
 
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