HDATE: Converting the Date Portion of a Timestamp 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 Timestamp Value to a Date Format
HDATE(timestamp, output_format)

where:

timestamp

Date-Time

Is the value to be converted.

output_format

Date

Is the date of any full component date format or just a full component date format in single quotation marks. This output_format can be assigned to any other date field (whether or not it is a full component), or to a numeric field.



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