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     [CLOSED] SQLORA passing date range issue

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED] SQLORA passing date range issue
 Login/Join
 
Member
posted
Hi All,

I am trying to write a sql query using below code:

SQL SQLORA SET SERVER servername
SQL SQLORA
select empname, hire_date, salary
from table_name
where hire_date between '01-JAN-06'
AND '31-DEC-07';

I suppose get number of rows records but somehow I got 0 record return.
I know it is something to do with the hire_date format. By default, this column in my oracle table showing as DATE data type. And when I create a master file, this field is showing as:HYYMDS format.

Does anyone know who to solve this issue?

Regards,

JZ

This message has been edited. Last edited by: Kerry,
 
Posts: 28 | Registered: October 26, 2006Report This Post
Expert
posted Hide Post
quote:
HYYMDS

If the master is showing that format, then hire_date is a DATETIME field, not a date field.

Could you try just printing hire_date without a screening condition but with a recordlimit to see what it looks like and then adjust the WHERE clause to match.


Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
 
Posts: 2723 | Location: Ann Arbor, MI | Registered: April 05, 2006Report This Post
Virtuoso
posted Hide Post
If the field in your Oracle database is a date-time field, then your best bet would be to use a date-time value in your selection criteria that matches your actual field format such as

20060101 00:00:00 and 20071231 23:59:59

I don't know the exact format of an Oracle timestamp, but 01-JAN-06 is not going to work. Use your Oracle tool to get the exact format or maybe another Oracle user out there would be kind enough to give you the answer.


Regards,

Darin



In FOCUS since 1991
WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex
Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex
WF Client: 77 on Linux w/Tomcat
 
Posts: 2298 | Location: Salt Lake City, Utah | Registered: February 02, 2007Report This Post
Master
posted Hide Post
You are using oracle passthru which will disregard wf masters.

Use TO_DATE function to convert your screening string to an Oracle internal date.



Server: WF 7.6.2 ( BID/Rcaster) Platform: W2003Server/IIS6/Tomcat/SQL Server repository Adapters: SQL Server 2000/Oracle 9.2
Desktop: Dev Studio 765/XP/Office 2003 Applications: IFS/Jobscope/Maximo
 
Posts: 888 | Location: Airstrip One | Registered: October 06, 2006Report This Post
Master
posted Hide Post
quote:
where hire_date between '01-JAN-06'
AND '31-DEC-07';



Try:
where to_date(hire_date,'DD/MM/YYYY') between to_date('01/01/2006','DD/MM/YYYY') AND to_date('31/12/2007','DD/MM/YYYY');


You can use MON instead of MM if you want to use the abbreviated month instead of the numeric month.


Pat
WF 7.6.8, AIX, AS400, NT
AS400 FOCUS, AIX FOCUS,
Oracle, DB2, JDE, Lotus Notes
 
Posts: 755 | Location: TX | Registered: September 25, 2007Report This Post
Member
posted Hide Post
Yes, I have trid to change my code to:
to_date('&BEG_PP', 'mm/dd/yy')
and it works.

Thanks a lot for everyone's help!
 
Posts: 28 | Registered: October 26, 2006Report This Post
Gold member
posted Hide Post
I was able to paramaterize the date this way without having to use TO_DATE. I called the parameter &ORACLEDATE. This shows a prompt box and I type in the date as 25-JUL-2012. The field DATE_UPDATED is the col name in the Oracle Table and has a data type of date. To use this example in the WHERE clause of the SQLORA section:

 
WHERE trunc(date_updated) = '&ORACLEDATE'


WebFocus 7.7.03
Win7, all output
 
Posts: 80 | Registered: January 26, 2011Report 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     [CLOSED] SQLORA passing date range issue

Copyright © 1996-2020 Information Builders