makedate

Declaration

date function makedate(Integer year, Integer month, Integer day, Integer hour, Integer minute, Integer second)

Description

makedate returns a date variable created from the input parameters. The input parameters may have the following ranges:

month 1-12

day 1-31

hour 0-23

minute 0-59

sec 0-59

All parameters are converted to a positive value and range checked. If the range is exceeded the value of it and its sister are adjusted accordingly. See the last example.

Example Stored Procedure

CREATE PROCEDURE test_makedate ( yr INTEGER,mon INTEGER, dy INTEGER, hr INTEGER, mn INTEGER, sec INTEGER)

RETURNS (result date) AS

BEGIN

result = makedate(yr,mon, dy,hr,mn,sec);

END!!

WISQL -
calling the example stored procedure

execute procedure test_makedate(1996,1,1,1,1,1);

RESULT

====================

1-JAN-1996 01:01:01

execute procedure test_makedate(1996,13,1,1,1,1);

RESULT

====================

1-JAN-1997 01:01:01

execute procedure test_makedate(1996,1,32,1,1,1);

RESULT

====================

1-FEB-1996 01:01:01