Solved

Parameter Fields and Record Filtering

Posted on 2011-02-28
6
352 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
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

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…
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 …
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

759 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now