HCNVRT: Converting a Date-Time Value to Alphanumeric Format

How to:

The HCNVRT function converts a date-time value to alphanumeric format for use with operators such as EDIT, CONTAINS, and LIKE.


Top of page

x
Syntax: How to Convert a Date-Time Value to Alphanumeric Format
HCNVRT(timestamp,(format), length, output_format)

where:

timestamp

Date-Time

Is the value to be converted.

format

Alphanumeric

Is the format of the timestamp enclosed in parentheses. It must be a date-time format (H format).

length

Integer

Is the number of characters in the alphanumeric field that is returned. If the length is smaller than the number of characters needed to display the alphanumeric field, the function returns a blank.

output_format

Alphanumeric



Example: Converting a Date-Time Value to Alphanumeric Format

Assume that you have a date-time field DTCUR in H format. To convert this timestamp to an alphanumeric string, use the following syntax:

HCNVRT(DTCUR, '(HMDYYS)', 20, 'A20')

The function returns the string '03/26/2004 14:25:58' that is assignable to an alphanumeric variable.


iWay Software