Sybernet / Supplied Functions Reference
Release 3.00
Oct 14, 2002
backwards forwards

HTTP.DATEPART

The datepart and datename functions produce the specified part of a date--the year, quarter, day hour and so on--as either an integer or an ASCII string.

Syntax

FUNCTION DATEPART
(
    DATEPART                      VARCHAR2
,   DATETIME                      DATE
)
RETURN NUMBER;

Parameters

Parameter Description
datepart
 
Date Part     Abbreviation   Values
------------- -------------- ---------------------------------
year          yy             1753 - 9999
quarter       qq             1 - 4
month         mm             1 - 12
dayofyear     dy             1 - 366
day           dd             1 - 31
week          wk             1 - 54
weekday       dw             1 - 7 (1 is Sunday in us_english)
hour          hh             0 - 23
minute        mi             0 - 59
second        ss             0 - 59
datetime
 
A date value.

Returns

Part of a date value.

Example

The following example illustrates how to call datepart.

select datepart('month',sysdate) from dual;


--------------
            10



Sybernet is a trademark of SRI International.
Copyright © 1996-2008 SRI International. All Rights Reserved.
Denis D. Workman / http://Sybernet.sri.com/