Solved

Parameter Fields and Record Filtering

Posted on 2011-02-28
6
358 Views
Last Modified: 2012-05-11
I'm using Crystal XI

I have created a report that has three date column fields.  I want to filter on one or more of those fields.

I have added three Parameter Fields (DateParam1, DateParam2 and DateParam3) linked to their respective value fields and set and "Allow Range"

Then I dropped the three parameter fields on the Report Header and, finally, I added the Report Selection Formula s below:

{Month_End_Adjusting.GL_Date_Posted1} in {?DateParam1} or
{Month_End_Adjusting.GL_Date_Posted2} in {?DateParam2} or
{Month_End_Adjusting.GL_Date_Posted3} in {?DateParam3}

Open in new window


Once the editing is done, I test adding the date range 2011/01/01 to 2011/01/31 to all three parameters.

The problem seems to be that it only filters on the first entry.  That is, as it's written, only those rows where GL_Date_Posted1 are between 2011/01/01 and 2011/01/31.  If I then comment out the first line only those rows where GL_Date_Posted2 are between 2011/01/01 and 2011/01/31 are shown.  If I then also comment out the second line only those rows where GL_Date_Posted3 are between 2011/01/01 and 2011/01/31.are shown.

Just as an aside, and I'm not sure if this is relevant, but and record will only have data in one field.  Which ever of the three has a date, the other two will always be blank.
0
Comment
Question by:Clif
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 5

Expert Comment

by:analliah
ID: 35000266
not a big expert  but here is what I think

 using OR only require the one of the parameters to be satisfied.  If the you date range needs to satisfy all 3 data field try using AND
0
 
LVL 5

Expert Comment

by:analliah
ID: 35000332
I can't type !

using OR only require one of the parameters to be satisfied. If you date range needs to satisfy all date_posted field you need to  use AND

{Month_End_Adjusting.GL_Date_Posted1} in {?DateParam1} and
{Month_End_Adjusting.GL_Date_Posted2} in {?DateParam1} and
{Month_End_Adjusting.GL_Date_Posted3} in {?DateParam1}


I don't see a reason to create 3 different date parameters unless each of them requires the user to enter separate dates.
0
 
LVL 10

Author Comment

by:Clif
ID: 35000362
No joy.

The database records will look something like this:
Vendor  Post_Amt1   Post_Date1  Post_Amt2  Post_Date2  Post_Amt3  Post_Date3
AAA        123.00   01/03/2011
BBB       5432.10   12/16/2010
BBB                               9182.73  01/16/2011
CCC                                                      6383.22  11/19/2010
CCC       7654.76   01/12/2011
DDD                                123.45  11/16/2010

Open in new window


When all is said and done, and the report is run given the paraneters noted in my original post, the result should be this:
Vendor  Post_Amt1   Post_Date1  Post_Amt2  Post_Date2  Post_Amt3  Post_Date3
AAA        123.00   01/03/2011
BBB                               9182.73  01/16/2011
CCC       7654.76   01/12/2011

Open in new window

0
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 10

Author Comment

by:Clif
ID: 35000381
On your second post...

I agree, but the customer says they want to filter on all three dates separately.
0
 
LVL 101

Accepted Solution

by:
mlmcc earned 500 total points
ID: 35000518
You have to account for the NULL values.

Try this

(
Not IsNull({Month_End_Adjusting.GL_Date_Posted1}) AND
{Month_End_Adjusting.GL_Date_Posted1} in {?DateParam1}
)
OR

(
Not IsNull({Month_End_Adjusting.GL_Date_Posted2}) AND
{Month_End_Adjusting.GL_Date_Posted2} in {?DateParam1}
)
OR

(
Not IsNull({Month_End_Adjusting.GL_Date_Posted3}) AND
{Month_End_Adjusting.GL_Date_Posted3} in {?DateParam1}
)

Crystal stops processing the formula when it hits a NULL value.  The result is not determined

mlmcc
0
 
LVL 10

Author Closing Comment

by:Clif
ID: 35000649
That did it.  Thanks.
0

Featured Post

Enroll in June's Course of the Month

June's Course of the Month is now available! Every 10 seconds, a consumer gets hit with ransomware. Refresh your knowledge of ransomware best practices by enrolling in this month's complimentary course for Premium Members, Team Accounts, and Qualified Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
Come and listen to Percona CEO Peter Zaitsev discuss what’s new in Percona open source software, including Percona Server for MySQL (https://www.percona.com/software/mysql-database/percona-server) and MongoDB (https://www.percona.com/software/mongo-…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

717 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question