Focal Point
[SOLVED] Date Range I am using on Parameters not working properly

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/3187093386

August 11, 2016, 09:47 AM
NCochran
[SOLVED] Date Range I am using on Parameters not working properly
[IMG]C:\Users\ncochran\Desktop\image 1.png[/IMG]

I am wanting to create a date range for user to enter dates when running report.

When creating my 1st parameter (The is is the beginning date), in the filter, I use GE (>=) Simple Parameter

When creating my 2nd parameter (The is is the end date), in the filter, I use LE (<=) Simple Parameter. I had to create a define field to be able to create a 2nd field to enter in the fitler.

The result: When user enters dates such as 08/09/2016 for both parameters (should return any records with 08/09/2016). But it does not return data as it should. The only way to return the records of 08/09/2016 is to enter these dates in the parameter (begin: 08/09/2016, end: 08/10/2016)

I have confirmed that the 2nd parameter is using less then/ equal to.

Any thoughts?

This message has been edited. Last edited by: Tamra,


WebFOCUS 8
Windows, All Outputs
August 12, 2016, 02:48 AM
btiedemann
Hello NCochran,

I understand: The user should be able to enter 2 different parameters (condtions: GE and LE ) for one datefield as the filter,
but if the user enter the same date in both parameters, only this date should be selected by WebFOCUS.

The simple filter is not more available for us, so I can only use the advanced filter, my testcase:
On the searchdate I add one filter and name the parameter 'datefrom' and use GE as the condition
Then I add a second filter on the searchdate and name it 'dateto' and use LE.
And it works well in our WebFOCUS.

Could you change the name of the parameters? If not, use the advanced filter.

Regards

Bernd


WebFOCUS 8.1
Build Version: 8105m
Build/GEN Number: 187 Application Server: Apache Tomcat/7.0.33
Windows, All Outputs
August 12, 2016, 08:54 AM
Msondra
Hi NCochran,
You might want to check the format of the date you are using. Does it have a time stamp?

Also, you may want check to see what is actually being passed through the parameter.

The following code works against the IBI sample database Movies.
-***************************************************************************
-* If you are passing an &variable from an HTML page or drill link and you don't think the
-* the variable value is going to the target .fex put the following in the top part of the
-* target .fex. -? & followed by -EXIT. This will list all the &variables available to the
-* target .fex.

-* Remove the comments from the next 2 lines in order to see the values of & variables.
-*-? &
-*-EXIT


-*-DEFAULT &BEGIN_DATE = '88/01/01';
-*-DEFAULT &END_DATE = '90/12/31';

-DEFAULT &BEGIN_DATE = '89/02/08';
-DEFAULT &END_DATE = '89/02/08';

TABLE FILE MOVIES
PRINT
RATING
WHOLESALEPR
LISTPR
COPIES
BY LOWEST RELDATE
BY MOVIECODE
BY TITLE
BY CATEGORY
BY DIRECTOR
WHERE RELDATE GE '&BEGIN_DATE';
WHERE RELDATE LE '&END_DATE';
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE SET ASNAMES ON
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET HTMLEMBEDIMG ON
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
INCLUDE = IBFS:/EDA/EDASERVE/_EDAHOME/ETC/endeflt.sty,
$
ENDSTYLE
END


WebFOCUS 8.1.05
Windows, All Outputs
August 17, 2016, 08:27 AM
Tamra
NCochran
The Advance Filter will provide the option to set up a 'datefrom' and a 'dateto' as btiedemann has suggested.

Hope that helps you out with your question about date ranges.

Thank you for participating in the Focal Point Forum

Kind Regards,
Tamra Colangelo
IBI Focal Point Moderator


WebFOCUS 8x - BI Portal, Developer Studio, App Studio, Excel, PDF, Active Formats and HTML5
August 17, 2016, 08:42 AM
NCochran
I am still actually experiencing the same issue. I have setup the advanced filter properly. I have datefrom >= and dateto <=.

My date record I am trying to return is 08/09/2016. My filter is datefrom >= 08/09/2016 and dateto <= 08/09/2016

When ran, this returns no data. But if I change the dateto <= 08/10/2016, then the record will return.

Any ideas on this? Any input would be great.


WebFOCUS 8
Windows, All Outputs
August 18, 2016, 09:39 AM
Kevin W
It seems to me that the field you are selecting from must be a date/time field and that the time values have content. In that case the compare actually generated would be (not literally but figuratively) >=08/09/2016 00:00:00.000 to <=08/09/2016 00:00:00.000. That leaves no time window for the selection. So you would only get any data returned that is exactly equal to 08/09/2016 00:00:00.000 [the stroke of midnight). Therefore when you enter <=08/10/2016 you are actually getting the 08/10/2016 00:00:00.000 date/time for that day and getting what you need returned. From midnight the morning of the 9th until midnight the morning of the 10th. Does that make sense?


WebFOCUS 7.7.05 (Someday 8)
Windows 7, All Outputs
In Focus since 1983.
August 19, 2016, 10:34 AM
NCochran
Thanks for everyone's response. Much appreciated.


WebFOCUS 8
Windows, All Outputs