148
Chapter 8
Function Result Description
date_in_weeks(DATE) Real
Returns the time in weeks from the baseline date to
thed ate ortim estamp represented by DATE, as a real
number. This is based on a week of 7.0 days. If DATE
is before the baseline date, this function returns a
negative number. You must include a valid date for
the calculation to work appropriately. For example,
yous hould not specify 29 February 2001 as the date.
Because 2001 is a not a leap year, this date does not
exist.
date_in_years(DATE) Real
Returns the time in years from the baseline date to
thed ate ortim estamp represented by DATE, as a real
number. This is an approximate gure based on a
year of 365.25 days. If DATE is before the baseline
date, this function returns a negative number. You
must include a valid date for the calculation to work
appropriately. For example, you should not specify 29
February 2001 as the date. Because 2001 is a not a
leap year,th is date does not exist.
date_months_difference
(DATE1,DATE2) Real
Returnsthe tim e in months from the date or timestamp
represented by DATE1to that repre sented by DATE2,
asa real number. This is an approximate gure based
on a month of 30.4375 days. If DATE2 is before
DATE1,this function ret urns a negative number.
datetime_date(YEAR, MONTH,
DAY) Date Createsa date value for the given YEAR,MONTH, and
DAY.The arguments must be integers.
datetime_day(DATE) Integer Returnsthe day of the month from a given DATE or
timestamp. The result is an integer in the range 1 to 31.
datetime_day_name(DAY) String
Returnsthe f ull name of the given DAY.The argument
must be an integer in the range 1 (Sunday) to 7
(Saturday).
datetime_hour(TIME) Integer Returns the hour from a TIME or timestamp. The
result isa nin teger in ther ange0 to 23.
datetime_in_seconds(TIME) Real Returns the seconds portion stored in TIME.
datetime_in_seconds(DATE),
datetime_in_seconds(DATE-
TIME)
Real
Returns the accumulated number, converted into
seconds,from the difference between the current DATE
orDATETIME and the baseline date ( 1900-01-01).
datetime_minute(TIME) Integer Returns the minute from a TIME or timestamp. The
result isa nin teger in ther ange0 to 59.
datetime_month(DATE) Integer Returnsthe mon th from a DATEor timestam p. The
result isa nin teger in ther ange1 to 12.
datetime_month_name
(MONTH) String Returns the full name of the given MONTH. The
argumentmust be an integer in the range 1 to 12.
datetime_now Timestamp Returnsthe curren t time as a timestamp.
datetime_second(TIME) Integer Returns the second from a TIME or timestamp. T he
result isa nin teger in ther ange0 to 59.
datetime_day_short_
name(DAY) String
Returns the abbreviated name of the given DAY. The
argumentm ust be an integer in the range 1 (Sunday)
to 7 (Saturday).
datetime_month_short_
name(MONTH) String Returns the abbreviated name of the given MONTH.
Theargument must b e anin teger in the range 1 to 12.
datetime_time(HOUR, MINUTE,
SECOND) Time
Returns the time value for the specied HOUR,
MINUTE, and SECOND. The arguments must be
integers.