How to get the Day part from the given Date?

 Posted by Lakhangarg on 2/22/2010 | Category: Sql Server Interview questions | Views: 4560

There are two methods to get the Date part from given date:
DECLARE @GivenDate datetime
SET @GivenDate='2010-02-22 23:06:38.300'

(1) DAY(GETDATE()) Output: 22
(2) DatePart(d,GETDATE()) Output: 22

Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response