Saturday, July 28

Get month and year from a datetime in SQL Server 2005


datepart(year,getdate()) - returns year in int
datepart(month,getdate()) - returns month in int
datename(month,getdate()) - returns month name in string

Thanks 
shibashish Mohanty

No comments:

Post a Comment

Please don't spam, spam comments is not allowed here.

.

ShibashishMnty
shibashish mohanty