Solved

Parameter Fields and Record Filtering

Posted on 2011-02-28
6
354 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
Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

 
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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

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. …
There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

777 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