VistaDB 6
VistaDB / Developer's Guide / SQL Reference / Functions / Date and Time Functions / DATEPART
In This Topic
    DATEPART
    In This Topic
    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



    Example

    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