Focal Point
[CLOSED] DATECVT Conversion

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/9607031776

July 07, 2015, 10:57 AM
hfung1
[CLOSED] DATECVT Conversion
Hi,

I have a field in yyyy-mm-dd HH.MM.SS.MSS in the HYYMDs format. I would like to just strip it to just show yyyy-mm-dd in a YYMD format. I tried to make a define using the DATECVT function but it is not working for me. Any suggestions? Thank you.

This message has been edited. Last edited by: <Kathryn Henning>,


8.0.0.2
Windows, All Outputs
July 07, 2015, 11:14 AM
CoolGuy
Go into the master file and switch out the Usage format of the field.


8.2.02M (production), 8.2.02M (test), Windows 10, all outputs.
July 07, 2015, 11:18 AM
Francis Mariani
Use the HDATE function. From the docs:
quote:

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".

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, the name of a date-time field that contains the value, or an expression that returns the value.

output - Date - Is the format in single quotation marks or the field that contains the result.

TABLE FILE VIDEOTR2
PRINT CUSTID TRANSDATE AS 'DATE-TIME' AND COMPUTE
TRANSDATE_DATE/YYMD = HDATE(TRANSDATE, 'YYMD');
WHERE DATE EQ 2000;
END



Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server