HDATE: Converting the Date Portion of a Date-Time Value to a Date Format

How to:

The HDATE function converts the date portion of a date-time value to the date format YYMD. You can then convert the result to other date formats.


Top of page

x
Syntax: How to Convert the Date Portion of a Date-Time Value to a Date Format
HDATE(datetime, output

where:

datetime

Date-time

Is the date-time value to be converted.

output

Date



Example: Converting the Date Portion of a Timestamp Value to a Date Format

This example converts the DTCUR field, which is the current date/time timestamp, into a date field using the format DMY:

MYDATE/DMY = HDATE(DTCUR, 'YYMD');

The function returns the date in format YYMD, then assigns it to MYDATE after conversion to its format MY as 03/04. Note that the output_format of HDATE is presented as a full component date format MDYY, as required.


iWay Software