To find first day of month.

Omniitstudent
Posted by Omniitstudent under Sql Server category on | Points: 40 | Views : 2001
select DATENAME(DW,DATEADD(DD,-DATEPART(dd,getdate())+1,GETDATE()))

crazy code -->

Comments or Responses

Posted by: Pandians on: 2/19/2012 Level:Silver | Status: [Member] [MVP] | Points: 10
Hi
Nice Try.
You can also try simply as follows
Select DateName(WEEKDAY,GETDATE() - DAY(GETDATE()) +1)

Posted by: Samarmir on: 2/21/2012 Level:Starter | Status: [Member] | Points: 10
please provide an example of what it will return

Login to post response