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     Defining or computing a number based on dates

Read-Only Read-Only Topic
Go
Search
Notify
Tools
Defining or computing a number based on dates
 Login/Join
 
Member
posted
Hi everyone,
I am attempting to create a number in days (&END1 - &BEG1) so I can use it for calcuations such as per day stats in my report.
I used a define:

DEFINE FILE CHGDTL2
DAYS_PER/I5 = (&END1 - &BEG1);

But I am getting a much higher number than it should be. For instance I get 129 when the number should be 61. Also if its important, at the end of the report I am placing this character (DAYS_PER) in the footer.

FOOTING BOTTOM
"
Any ideas?

Thank you.


WebFocus 7.6.6 Win 2K
 
Posts: 29 | Registered: June 19, 2006Report This Post
Guru
posted Hide Post
What format are your dates in?
Date arithmetic is done differently for different date types.


(Prod: WebFOCUS 7.7.03: Win 2008 & AIX hub/Servlet Mode; sub: AS/400 JDE; mostly Self Serve; DBs: Oracle, JDE, SQLServer; various output formats)
 
Posts: 391 | Location: California | Registered: April 14, 2003Report This Post
Member
posted Hide Post
Hi N.Selph,
The format of the field is P9. I will try changing this format to a date format and see if that works. Do you have suggestions on a particular date format? Thanks for the response.


WebFocus 7.6.6 Win 2K
 
Posts: 29 | Registered: June 19, 2006Report This Post
Guru
posted Hide Post
Is this an input field or coming from or matching some data source? If it is an input field you should convert it to the date data type you use in your data source for more effective data retrieval.
In the P9 field - it will be effectivly some kind of date - either a Julian, offset date (ie an integer such as a Smart Date) or something like 20061218 - Integer legacy date. Depending on what it is, it is easiest for you to "convert" it (define it to WebFocus) to the one it naturally already is.
If you can convert it to a Smart date format (YYMD), then you can subtract directly just like you are, and the formula will work. Or you can use the DATEDIF function.
If you have an integer legacy date (I8YYMD), you will need to use the YMD function:
 
DAYS_PER/I5=YMD(&BEG1,&END1,'I5');
 


(Prod: WebFOCUS 7.7.03: Win 2008 & AIX hub/Servlet Mode; sub: AS/400 JDE; mostly Self Serve; DBs: Oracle, JDE, SQLServer; various output formats)
 
Posts: 391 | Location: California | Registered: April 14, 2003Report This Post
Member
posted Hide Post
Sorry for the delay but wanted to post an update. I found that N. Selph was dead on! It was in P9 format so was basically subtracting the numbers rather than the dates (i.e. subtracting 20070222 - 20070101 = 121). So long as BEG1 and END1 are in the same month no problem, otherwise would need to convert as N. Selph suggested. Thanks for the help!!!


WebFocus 7.6.6 Win 2K
 
Posts: 29 | Registered: June 19, 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     Defining or computing a number based on dates

Copyright © 1996-2020 Information Builders