![]() ![]() ![]() |
Returns the specified part of a date as an integer.
See also DateAdd and DateDiff.
DatePart(datepart, date)
One of the following strings:
yyyy
-- Year
q
-- Quarter
m
-- Month
y
-- Day of year
d
-- Day
w
-- Weekday
ww
-- Week
h
-- Hour
n
-- Minute
s
-- Second
Any date.
Years less than 100 are interpreted as 20th century values.
When passing a date/time value as a string, make sure it is enclosed in quotes. Otherwise, it is interpreted as a number representation of a date/time object, returning undesired results.
![]() ![]() ![]() |
AllaireDoc@allaire.com
Copyright © 1998, Allaire Corporation. All rights reserved.