C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Communities   Interview   Jobs   Projects   Offshore Development    
Silverlight Tutorials | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Revenue Sharing |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...

New Feature: Community Sites: Create your own .NET community website and start earning from Google AdSense ! It's Free !




How to find First Day Of The Current Month


Posted Date: 16 May 2008    Resource Type: Code Snippets    Category: SQL
Author: Shree N JhaMember Level: Bronze    
Rating: Points: 10



The following code sample shows How to find first Day Of The Current Month

Select DateAdd(Month,DateDiff(Month,0, GETDATE()),0)




Responses

Author: Chandrasekhar    19 May 2008Member Level: Silver   Points : 2
DECLARE @mydate DATETIME
SELECT @mydate = getdate()
SELECT CONVERT(VARCHAR(25),DATEADD(dd,-(DAY(@mydate)-1),@mydate),101) AS Date_Value



Author: Nirupa Rani Acharya    27 Jul 2008Member Level: Bronze   Points : 0
thanks.


Author: amit chaudhary    22 Aug 2008Member Level: Silver   Points : 1
This is the code for calculating first day of the month:-

Select DateAdd(Month,DateDiff(Month,0, GETDATE()),0)


Feedbacks      
Popular Tags   What are tags ?   Search Tags  
(No tags found.)

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: How to view the user created tables in SQL Server
Previous Resource: Check for existence of DB using SQL
Return to Discussion Resource Index
Post New Resource
Category: SQL


Post resources and earn money!
 
Related Resources



dotNet Slackers   BizTalk Adaptors    Web Design


Contact Us    Privacy Policy    Terms Of Use