9.0
132
dateexpr definition
An expression that returns a date result. Use #literal-date# to express a date value.
#1/1/2000# ' Jan 1, 2000
Now
+7 ' seven days from now
DateSerial
(Year(Now)+1,Month(Now),Day(Now))
' one year from now
DatePart Function
Syntax
DatePart(interval, dateexpr)
Group
Time/Date
Description
Return the number from the date corresponding to the interval.
Parameter Description
interval This string value indicates which kind of interval to extract.
dateexpr Get the interval from this date value. If this value is Null then Null is returned.
Parameter Description
yyyy Year (100-9999) Quarter (1-4)
m Month (1-12)
y Day of year (1-366)
d Day (1-31)
w Weekday (1-7)
ww Week (1-53)
h Hour (0-23)
n Minute (0-59)
s Second (0-59)
See Also: DateAdd, DateDiff.
Example
Sub Main
Debug
.Print DatePart("yyyy",#1/1/2000#) ' 2000
End
Sub
DateSerial Function
Syntax
DateSerial(Year, Month, Day)










