Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] How to increment an HHISsm formatted field by 15 mins?

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] How to increment an HHISsm formatted field by 15 mins?
 Login/Join
 
Virtuoso
posted
Anyone know how to increment time values by 15 minutes? There are functions for DATETIME formats but none that I can see for just TIME fields.

Any help is much appreciated!

Thanks!

This message has been edited. Last edited by: CoolGuy,


8.2.02M (production), 8.2.02M (test), Windows 10, all outputs.
 
Posts: 1113 | Location: USA | Registered: January 27, 2015Report This Post
Expert
posted Hide Post
I thought you can use the same function to add a period of time.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
Expert
posted Hide Post
As Waz suggests, look into the HADD function. HHISsm has hidden date components.

"The HADD function increments a date-time value by a given number of units."

TABLE FILE CAR
SUM 
SALES
COMPUTE TIME1/HHISsm = DT('12:56:12.123');
COMPUTE TIME2/HHISsm = HADD(TIME1, 'minute', 15, 8, TIME2);

BY COUNTRY
END

In a slightly related issue, questions have been asked about time-only fields, which I don't think is possible.


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
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Virtuoso
posted Hide Post
Thanks for your help guys. For some reason my SBTRANSTIME field with format HHISsm isn't valid as a DATE constant??

My code:
 
DEFINE FILE SCANDETAIL
TIME1/HHISsm = DT(SBTRANSTIME);
TIME2/HHISsm = HADD(TIME1, 'minute', 15, 8, TIME2);
END
TABLE FILE SCANDETAIL
SUM
     SCANDETAIL.SCANDETAIL.SDEXTSALES
     SCANDETAIL.SCANDETAIL.SDSCANQTY
     SCANDETAIL.SCANDETAIL.SDWEIGHT
BY  SCANDETAIL.SCANDETAIL.SDTRANSDATE
BY  SCANDETAIL.SCANDETAIL.SDACCTNO
BY  SCANDETAIL.SCANBASKET.SBCASHIER
BY  SCANDETAIL.SCANBASKET.SBTRANSTIME
WHERE SCANDETAIL.SCANDETAIL.SDTRANSDATE EQ '20160317';
WHERE SCANDETAIL.SCANDETAIL.SDACCTNO EQ 10116;
WHERE SCANDETAIL.SCANBASKET.SBCASHIER EQ 120;
WHERE SCANDETAIL.SCANBASKET.SBTRANSTIME GE '17:00:00';
WHERE SCANDETAIL.SCANBASKET.SBTRANSTIME LT TIME2;
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE SET ASNAMES ON
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET HTMLEMBEDIMG ON
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
     INCLUDE = IBFS:/EDA/EDASERVE/_EDAHOME/ETC/endeflt.sty,
$
ENDSTYLE
END


Output:
 0 ERROR AT OR NEAR LINE      2  IN PROCEDURE ADHOCRQ FOCEXEC *
 (FOC177) INVALID DATE CONSTANT: SBTRANSTIME
 0 ERROR AT OR NEAR LINE      3  IN PROCEDURE ADHOCRQ FOCEXEC *
 (FOC258) FIELDNAME OR COMPUTATIONAL ELEMENT NOT RECOGNIZED: TIME1
 0 ERROR AT OR NEAR LINE     18  IN PROCEDURE ADHOCRQ FOCEXEC *
 (FOC258) FIELDNAME OR COMPUTATIONAL ELEMENT NOT RECOGNIZED: TIME2
 BYPASSING TO END OF COMMAND
 (FOC009) INCOMPLETE REQUEST STATEMENT


8.2.02M (production), 8.2.02M (test), Windows 10, all outputs.
 
Posts: 1113 | Location: USA | Registered: January 27, 2015Report This Post
Virtuoso
posted Hide Post
Nevermind. Got it working finally. Thanks Francis!

Working code:
-DEFAULT &DATE1 = 20160317;
-DEFAULT &TIME1 = 171500;

DEFINE FILE SCANDETAIL
	TRANSTIME/HHIS = SBTRANSTIME;
	TIME1/HHIS = DT(&TIME1);
	TIME2/HHIS = HADD(TIME1, 'minute', 15, 8, TIME2);
END

TABLE FILE SCANDETAIL
SUM
    SDEXTSALES/D12.2CM
    SDSCANQTY
    SDWEIGHT/D12.2C

BY  SDTRANSDATE
BY  SDACCTNO
BY  SBCASHIER
BY  TRANSTIME
WHERE SDTRANSDATE EQ &DATE1;
WHERE SDACCTNO EQ 10116;
WHERE SBCASHIER EQ 120;
WHERE SBTRANSTIME GE TIME1;
WHERE SBTRANSTIME LT TIME2;
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE SET ASNAMES ON
ON TABLE RECOMPUTE SUM. SDWEIGHT SUM. SDSCANQTY SUM. SDEXTSALES AS 'Total:'
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET HTMLEMBEDIMG ON
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
     INCLUDE = IBFS:/EDA/EDASERVE/_EDAHOME/ETC/endeflt.sty,
$
ENDSTYLE
END


8.2.02M (production), 8.2.02M (test), Windows 10, all outputs.
 
Posts: 1113 | Location: USA | Registered: January 27, 2015Report This Post
Expert
posted Hide Post
Yes, DT only takes literals


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] How to increment an HHISsm formatted field by 15 mins?

Copyright © 1996-2020 Information Builders