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 am pulling in a Oracle Date Time and needing to compare it to a passed in begin and end date time. I collect the begin and end date portion using the calender html tool and the Hour, Min, Second as seperate integers. I parse the begin and end date times into a alpha string and then would like to compare against my oracle datetime coming in. Of course you can't compare a datetime to an alpha and i'm pulling my hair out. I can't seem to get the begin date time strings to be converted into a focus date time field and i can't seem to get go the other way and convert the oracle datetime field into an alpha. I'd like to compare it has alpha strings. Here is the field
How would i get the above dPublished into an Alpha field in the format HYYMD-SA so that i could compare it against the begin and end datetime strings i formated to look the same?
Thanks
JohnThis message has been edited. Last edited by: Kerry,
You might want to provide us an example value of &BeginDate.
This works:
-SET BeginDate = '20110425';
DEFINE FILE CAR
BEGIN_DATE/A8YY|M|D = '&BeginDate';
END
TABLE FILE CAR
PRINT
BEGIN_DATE
BY COUNTRY
END
Despite what some people believe, you do not need to know rocket science to work with date-time fields.
"Of course you can't compare a datetime to an alpha and i'm pulling my hair out" - actually, you can - here are some examples:
WHERE START_DT_CORRECTED FROM DT(20011101 00:00:00.000) TO DT(20021031 23:59:59.999);
WHERE AS_OF_TMS GE DT(&ENDDATE 00:00:00)
WHERE AS_OF_TMS LE DT(&ENDDATE 23:59:59)
WHERE SUBMITDATE FROM DT(&RNG_S.EVAL 00:00:00.000) TO DT(&RNG_E.EVAL 23:59:59.999);
The DT function converts the alpha Date/Time string to a Date/Time value that can be used in a WHERE statement in a WebFOCUS request.
You can use the Oracle function to_date to embed an alpha Date/Time string in a SQL request:
SQL SQLORA
SELECT MAX(T1.AS_OF_TMS) FROM EDA.P7V202 T1 WHERE
(T1.SNAPSHOT_TYPE = 'VALUATN') AND (T1.AS_OF_TMS BETWEEN
TO_DATE('31-10-2001 00:00:00','DD-MM-YYYY HH24:MI:SS') AND
TO_DATE('31-10-2001 23:59:59','DD-MM-YYYY HH24:MI:SS')) AND
(T1.ACCT_ID = '000102210');
END
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
The direct assignment to a legacy date (A8YYMD) doesn't work because of the slashes in the input date. (Don't know why FOCUS can't figure this out, but....) One solution is to convert the input date to a SmartDate before changing it to a legacy date. This should work:
To help others that may stumble across this here is the final version that worked for the begin date and time to compare against the oracle date. And for those of you who look at the code below and wonder why i couldn't just write EDIT(&BeginHour) it didn't work.
Creating a virtual column to satisfy selection criteria is not an efficient programming method and I have never had to resort to it. Those DEFINE fields are created for every row in the Oracle table.
I would suggest you look at the code I posted - much more efficient, no field format conversions - just one alpha string conversion.
This kind of thing sometimes results in the question "why does my WebFOCUS report take so long to run?".
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