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     DATE-TIME field in a Where statement

Read-Only Read-Only Topic
Go
Search
Notify
Tools
DATE-TIME field in a Where statement
 Login/Join
 
Guru
posted
Hi Team,

I have a DATE-TIME field on a SQL/R3 db, and the masterfile has been set to USAGE=MDYY ACTUAL=DATE.

When the user enters a date range, it will show data only up to the day before the ToDate that they enter. I think this is because WF is sending 01/02/2007 00:00:00, which is functionally 01/01/2007. The only way I have found to make the date range work out is to do a DATEADD function on the variable provided and add one additional day.

Is there a more elegant way to handle this?

Cheers,

Joey


-WebFOCUS 8.2.01 on Windows
 
Posts: 318 | Location: Los Angeles, CA | Registered: November 15, 2005Report This Post
Expert
posted Hide Post
Quite often I code my Date selection statements like this:

WHERE SCHEDULEDSTART FROM DT(&DADATE 00:00:00.000) TO DT(&DADATE 23:59:59.999);

(The .000 and .999 is for milliseconds)


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
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Master
posted Hide Post
Francis,

Will your WHERE clause be passed to the database or will FOCUS do the WHERE?

The problem occurs when there is a time in the data base so if one is doing an equality test, 01-02-2007 is not equal to 01-02-2007 02:00:00.

We do a lot of date testing (Oracle database) is our reporting. We typically set 2 & variables, &BEGDT and &ENDDT. For example, say we want the data for all of Jan 2007, &BEGDT is 20070101 and &ENDDT is 20070201. We just code:

WHERE TESTDT GE '&BEGDT' AND TESTDT LT '&ENDDT'

This does get passed to the database.


In FOCUS since 1985. Prod WF 8.0.08 (z90/Suse Linux) DB (Oracle 11g), Self Serv, Report Caster, WebServer Intel/Linux.
 
Posts: 975 | Location: Oklahoma City | Registered: October 27, 2006Report This Post
Expert
posted Hide Post
jgelona,

You do realise that you are testing for "less than", rather than "less than or equal to" in the where clause you posted?

quote:
WHERE TESTDT GE '&BEGDT' AND TESTDT LT '&ENDDT'


T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Expert
posted Hide Post
WHERE SCHEDULEDSTART FROM DT(&DADATE 00:00:00.000) TO DT(&DADATE 23:59:59.999);


Does get passed to SQL.

Turn on your SQL traces.

See this post on how to turn traces on:

https://forums.informationbuilders.com/eve/forums/a/tpc/...681009331#5681009331


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
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report 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     DATE-TIME field in a Where statement

Copyright © 1996-2020 Information Builders