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
Solved

Parameter Fields and Record Filtering

Posted on 2011-02-28
6
355 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
  • 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: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

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 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: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

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

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…
Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

828 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