September 05, 2007, 10:48 AM
Francis MarianiJason, give the HDIFF function a try:
quote:
Syntax: How to Find the Number of Units Between Two Date-Time Values
HDIFF(value1, value2, 'component', outfield) where:
value1 - Date-time - Is the end date-time value, the name of a date-time field that contains the value, or an expression that returns the value.
value2 - Date-time - Is the start date-time value, the name of a date-time field that contains the value, or an expression that returns the value.
component - Alphanumeric - Is the name of the component to be used in the calculation enclosed in single quotation marks. If the component is a week, the WEEKFIRST parameter setting is used in the calculation.
outfield - Floating-point double-precision -Is the field that contains the result, or the format of the output value enclosed in single quotation marks. The format must be floating-point double-precision.
E.G.:
CONF_DIFF/D12 = HDIFF(DT_ADLSCONF, DT_ADLSINIT, 'SECOND', CONF_DIFF);
DL_AGE/D8 = HDIFF(EFFECTIVEDATE,DATEOFBIRTH,'YEAR','D8');
MINUTES/D20 = HDIFF(COMPLETION_DATE,CREATION_DATE,'MINUTE','D20') ;
-SET &MILSEC = HDIFF(&ENDTIME, &BEGTIME, 'MILLISECOND', D12.2);
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
September 05, 2007, 12:13 PM
Jason K.great info!
thanks!
September 12, 2008, 11:01 AM
DougIs there a singe function to show the results of HDIFF or DATEDIF in a format such as DD HH:MM?
as follws:
A) (8/1/2008 4:58:00 PM) - (Aug 29, 08 2:08 PM) = 0 01:26 ... 0 days, 1 hour 26 minutes
B) (8/1/2008 4:58:00 PM) - (8/5/2008 6:24 PM) = 4 01:26 ... 4 days, 1 hour 26 minutes
[WF 764] Thanks in advance - Doug