VistaDB 5
int DATEPART( datepart, date )

Returns a character string of the requested part of the date.

The following are valid datepart parameters:

Datepart Abbreviations
year yy, yyyy
quarter qq, q
month mm, m
dayofyear dy, y
day dd, d
week wk, ww
weekday dw, w (Sunday, Monday, etc)
hour hh
minute mi, n
second ss, s
millisecond ms


Output: 1

Output: 4

Output: 2007
SELECT DATEPART(year, '01/04/2007')
SELECT DATEPART(day, '01/04/2007')
SELECT DATEPART(month, '01/04/2007')
See Also