Solved

Parameter Fields and Record Filtering

Posted on 2011-02-28
6
357 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
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 
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 100

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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Speed Up Crystal Report 5 73
Crystal Reports - Trim Data 7 84
display n/a in column 2 44
I need help with Crystal Report's Parameter Prompt Form 2 77
I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
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…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

734 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