SQL Query to find first day of month?

This is an interview question i have faced in most of the companies....

it's looks easy but it will trouble you at the interview hall........


SELECT DATENAME(dw, DATEADD(dd, - DATEPART(dd, GETDATE()) + 1, GETDATE())) AS FirstDay

No comments:

Post a Comment