Function Reference > Functions > MAKE_DATE_TIME
  

MAKE_DATE_TIME

Returns the date and time based on the input values.

Syntax

MAKE_DATE_TIME( year, month, day, hour, minute, second )
Argument
Required/
Optional
Description
year
Required
Numeric datatype. Positive integer.
month
Required
Numeric datatype. Positive integer between 1 and 12 (January=1 and December=12).
day
Required
Numeric datatype. Positive integer between 1 and 31 (except for the months that have less than 31 days: February, April, June, September, and November).
hour
Optional
Numeric datatype. Positive integer between 0 and 24 (where 0=12AM, 12=12PM, and 24 =12AM).
minute
Optional
Numeric datatype. Positive integer between 0 and 59.
second
Optional
Numeric datatype. Positive integer between 0 and 59.

Return Value

Date as MM/DD/YYYY HH24:MI:SS.

Example

The following expression creates a date and time from the source columns:
MAKE_DATE_TIME( SALE_YEAR, SALE_MONTH, SALE_DAY, SALE_HOUR, SALE_MIN, SALE_SEC )
SALE_YR
SALE_MTH
SALE_DAY
SALE_HR
SALE_MIN
SALE_SEC
RETURN VALUE
2002
10
27
8
36
22
10/27/2002 08:36:22
2000
6
15
15
17
06/15/200 15:17:00
2003
1
3
22
45
01/03/2003 ??:22:45
04
3
30
12
5
10
03/30/2004 12:05:10
99
12
12
5
16
12/12/1999?? 05:??:16