Focal Point Banner
Community Center Education Summit Technical Support User Groups
Let's Get Social!

Facebook Twitter LinkedIn YouTube
Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] Basic Date question from newbie
Go
New
Search
Notify
Tools
Reply
  
[SOLVED] Basic Date question from newbie
 Login/Join
 
Platinum Member
posted
I have a procedure that will be run in Report Caster that pulls information based on the AddDate field. I want it to pull information based on whether the AddDate field is less than or equal to &YYMD (RunDate) or greater than or equal to &YYMD - 5 (RunDateMin5).

What is the best way to do this? Should I define the fields in the metadata and then apply the filter in the procedure? When I tried this I used &YYMD as RunDate and DTADD(&YYMD,DAY,-5) as RunDateMin5. But I get no values for RunDateMin5.

Is this the best way to apply this filter and if so why do I get no values for RunDateMin5?

This message has been edited. Last edited by: <Kathryn Henning>,


WF8
Windows
 
Posts: 113 | Registered: May 28, 2015Reply With QuoteReport This Post
Master
posted Hide Post
-SET &DT1 = DATEADD(&YYMD, 'D', -5);



- FOCUS Man, just FOCUS!
-----------------------------
Product: WebFOCUS
Version: 8.1.04
Server: Windows 2008 Server
 
Posts: 578 | Registered: October 01, 2014Reply With QuoteReport This Post
Platinum Member
posted Hide Post
What is the benefit from doing it as a SET value in the procedure as opposed to creating it as a defined item in the metadata. What if I want to use it continually in other queries? I can't seem to get the format correct for filtering on if I create the RunDateMin5 as a define.

It did work using the SET solution.


WF8
Windows
 
Posts: 113 | Registered: May 28, 2015Reply With QuoteReport This Post
Master
posted Hide Post
Defines are created to add columns to a table, where sets are more for console fex level type stuff.

Method is the same and will work on Defines as well.

DEFINE FILE CAR
MYDATE/M-D-YY = DATEADD('&YYMD', 'D', -5);
END

TABLE FILE CAR
PRINT MYDATE
BY COUNTRY
ON TABLE PCHOLD FORMAT HTML
ON TABLE NOTOTAL
ON TABLE SET PAGE-NUM NOLEAD
END



- FOCUS Man, just FOCUS!
-----------------------------
Product: WebFOCUS
Version: 8.1.04
Server: Windows 2008 Server
 
Posts: 578 | Registered: October 01, 2014Reply With QuoteReport This Post
Member
posted Hide Post
quote:
solution.

As Gavin: stated, Defines add a value for every row to your table, so there's overhead involved. If you are calculating a static value, use Dialogue Manager whenever possible.


WebFOCUS 8.1.0.5m
 
Posts: 26 | Registered: October 09, 2007Reply With QuoteReport This Post
Master
posted Hide Post
TABLE FILE CAR
PRINT COMPUTE MYDATE/M-D-YY = DATEADD('&YYMD', 'D', -5);
BY COUNTRY
ON TABLE PCHOLD FORMAT HTML
ON TABLE NOTOTAL
ON TABLE SET PAGE-NUM NOLEAD
END



- FOCUS Man, just FOCUS!
-----------------------------
Product: WebFOCUS
Version: 8.1.04
Server: Windows 2008 Server
 
Posts: 578 | Registered: October 01, 2014Reply With QuoteReport This Post
Expert
posted Hide Post
Doesn't
 "AddDate field is less than or equal to &YYMD (RunDate) or greater than or equal to &YYMD - 5 (RunDateMin5)" 
equate to
 "WHERE AddDate LE RunDate OR AddDate GE RunDateMin5"? 
 
Posts: 3036 | Location: Middle Tennessee [8204M Gen48 in Test&Prod] | Registered: February 23, 2005Reply With QuoteReport This Post
Platinum Member
posted Hide Post
It seems to me that this condition is always true. Maybe it should be AND in stead of OR.


WebFocus 8203M, iWay DataMigrator, Windows, DB2 Windows V10.5, MS SQL Server, Azure SQL, Hyperstage, ReportCaster
 
Posts: 154 | Registered: March 29, 2013Reply With QuoteReport This Post
  Powered by Social Strata  
 

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] Basic Date question from newbie

Copyright © 1996-2018 Information Builders, leaders in enterprise business intelligence.