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] Sntax for using TODAY function in calculated field

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Sntax for using TODAY function in calculated field
 Login/Join
 
Member
posted
Hi All.
Sorry for what is probably a simple question but I can't find any documentation on this.
I want to calculate the number of days between a date on my database and the current date. My db date is a date time field so I used HDATE to convert this.
Then I wanted to use DATEDIF to get the number of days between that date and the current date but the only way I could see of getting the current date was the TODAY function. However I put this into the DATEDIF function I get an error, usually along the lines of invalid argument for TODAY.

Can anyone help please?
Thank you...

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


Release 8
Windows 7
Excel/HTML/PDF
Oracle 11g
 
Posts: 16 | Registered: October 23, 2012Report This Post
Guru
posted Hide Post
The problem iwth TODAY is that it returns an string representation of the date, which DATEDIF doesn't like.

I usually use the following:

DDFIF/I9 = DATEDIF('&YYMD', ORDER_DATE, 'Y');

OR

DDFIF/I9 = DATEDIF('&DATEYYMD', ORDER_DATE, 'Y');

Regards

Stuart


WebFOCUS 8.2.03 (8.2.06 in testing)
 
Posts: 253 | Location: Melbourne, Australia | Registered: February 07, 2007Report This Post
Member
posted Hide Post
Hello - Perhaps this will help? The first set statement is used in an include member and may need a little reworking for this purpose...

-SET &Current_dt = HCNVRT(HGETC(10,'HYYMDm'),'(H20)',20,'A20');
CURDTTIM/HYYMDm = HINPUT(20, '&Current_dt', 8, CURDTTIM);
DIFF_DAYS/D10 = HDIFF(end_date_for_calculation, CURDTTIM, 'DAY', 'D10');


Production: WebFocus 8.0.09 Test: WebFocus 8.0.09 Windows, Z-Linux, and ZOS.
all output
Focus - 7.2.7
 
Posts: 12 | Registered: July 21, 2010Report This Post
Member
posted Hide Post
Thanks for the replies.
I checked both methods and could use either, but the requester decided they could do without that field on the report this time so I haven't had to choose.
At least I'll know for next time...


Release 8
Windows 7
Excel/HTML/PDF
Oracle 11g
 
Posts: 16 | Registered: October 23, 2012Report 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] Sntax for using TODAY function in calculated field

Copyright © 1996-2020 Information Builders