DATEPART: return part of a date as an integer value : DATEPART « Date Timezone « SQL Server / T-SQL






DATEPART: return part of a date as an integer value


45> -- DATEPART: return part of a date as an integer value.
46>
47> -- DATEPART(part_of_the_date_to_return, the_date)
48>
49> SELECT DATEPART(dw,GETDATE())
50> GO

-----------
          5

(1 rows affected)
           
       








Related examples in the same category

1.Dateparts and Abbreviations
2.select DATEPART(weekday, '2002-09-30 11:35:00')
3.select DATEPART(week, '2002-09-30 11:35:00')
4.select DATEPART(quarter, '2002-09-30 11:35:00')
5.select DATEPART(dayofyear, '2002-09-30 11:35:00')
6.DATEPART(m,GETDATE())
7.DATEPART(dw,GETDATE())
8.DATEPART(yy,GETDATE())
9.DATEPART(wk,GETDATE())
10.DATEPART(n,GETDATE())
11.DATEPART(mi,GETDATE())
12.DATEPART(month, '4-29-1988')