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(datetime, '(format)', length, output)

where:

datetime

Date-time

Is the date-time value to be converted.

format

Alphanumeric

Is the format of the date-time field enclosed in parentheses and single quotation marks. It must be a date-time format (data type H, up to H23).

length

Integer

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

output

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