|Lesson 15|| The |
|Objective|| Create a |
datepart()function is easy to understand once you have worked with the other functions outlined in this module.
datepart()will return the portion of the date you indicate. In other words, if you want to know what week of the year a given date represents, you can use
DATEPARTto determine that value.
SELECT datepart(interval, date)
SELECT datepart(week, '5/2/1998')