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.
I have searched and have not been able to come up with a way to figure this out.
In a SQL table I have a field that represents YYYYMM format, ie. 200903 but it is an integer not a date. I want to create another field that has the current time, so since it is July the field would be 200907. From there I want to be able to find the difference between the two times, so if the SQL table say 200812 and the current says 200907 then there would be a difference of 7. How can I do that? I tried creating a current year column and month column and then combing them, but that did not work.
Any ideas?
Thanks, KerryThis message has been edited. Last edited by: Kerry,
You need to put the SQL dates into smartdates and then you can do arithmetic on them. Note that the integer fields need to have a date format on them:
DEFINE FILE CAR
BEGDTI/I6YYM=200812;
ENDDTI/I6YYM=200907;
BEGDT/YYM=BEGDTI;
ENDDT/YYM=ENDDTI;
DIFFMO/I4=ENDDT-BEGDT;
END
TABLE FILE CAR
PRINT BEGDTI ENDDTI BEGDT ENDDT DIFFMO
BY COUNTRY
WHERE READLIMIT EQ 1
END
There are probably a number of ways you can do this including using functions. But this example just uses simple equalities.
I was able to convert the SQL date...thanks but how do I create a current column that has the current date in it? I want this date to continue to move. So today, it would 200907 but in August, I would want it to be 200908.
The system variable that contains the current date is &YYMD. Here is an updated example.
DEFINE FILE CAR
BEGDTI/I6YYM=200812;
ENDDTI/YYMD=&YYMD;
BEGDT/YYM=BEGDTI;
ENDDT/YYM=ENDDTI;
DIFFMO/I4=ENDDT-BEGDT;
END
TABLE FILE CAR
PRINT BEGDTI ENDDTI BEGDT ENDDT DIFFMO
BY COUNTRY
WHERE READLIMIT EQ 1
END