DatePart: Difference between revisions
Jump to navigation
Jump to search
Created page with "DATEPART(''interval'', ''date''[, ''firstdayofweek''[, ''firstweekofyear'']]) '''Description''' DATEPART returns a number specifying a part of the given date. The required p..." |
No edit summary |
||
Line 3: | Line 3: | ||
'''Description''' | '''Description''' | ||
DATEPART returns a number specifying a part of the given date. The required parameter, interval, determines the part of date which is measured and returned. The optional parameter firstdayofweek is Sunday, if not specified The optional firstweekofyear is the week containing January 1, if not specified. | DATEPART returns a number specifying a part of the given date. The required parameter, ''interval'', determines the part of date which is measured and returned. The optional parameter ''firstdayofweek'' is Sunday, if not specified The optional ''firstweekofyear'' is the week containing January 1, if not specified. | ||
'''Example''' | '''Example''' |
Revision as of 02:45, 4 July 2012
DATEPART(interval, date[, firstdayofweek[, firstweekofyear]])
Description
DATEPART returns a number specifying a part of the given date. The required parameter, interval, determines the part of date which is measured and returned. The optional parameter firstdayofweek is Sunday, if not specified The optional firstweekofyear is the week containing January 1, if not specified.
Example
REM DATEPART Example 'DATEPART returns a numberfrompartofadate DIM QuarterPart, MonthPart, DayPart QuarterPart = DATEPART("q", NOW) MonthPart = DATEPART("m", NOW) DayPart = DATEPART("d", NOW) PRINT "Today is day " & DayPart PRINT "of month " & MonthPart PRINT "in quarter " & QuarterPart
Output
Today is day 18 of month 8 in quarter 3 (''sample output from August 18, 1998'')
Related Items