Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Suppress Details if one of two conditions is met

Status
Not open for further replies.

Pete271

Instructor
Feb 16, 2005
61
GB
Hi

I'm using Crystal Reports 8.5 and would like to suppress the details section using the following formula

[CnPrProp_1.CnPrProp_1_Date_Asked} <= DateTime (2007,07,31,00,00,00) OR
{CnPrProp_1.CnPrProp_1_Date_Funded} <= DateTime (2007,07,31,00,00,00)

Currently only records that meet the first section are being suppressed, the second statement is being ignored.

What am I doing wrong?

Thanks in advance for any help

Pete
 
Where are you placing this formula?

I suggest that rather than suppressing, you eliminate the rows from the report.

Use Report->Selection Formula->Record and place:

(
[CnPrProp_1.CnPrProp_1_Date_Asked} > DateTime (2007,07,31,00,00,00)
)
or
(
{CnPrProp_1.CnPrProp_1_Date_Funded} > DateTime (2007,07,31,00,00,00)
)

-k
 
I am placing the formula in the Section Expert.

I currently have

not ({CnPrProp_1.CnPrProp_1_Status} in "", "Identified", "Withdrawn"])

as the record selection formula.

I have tried replacing the formula and the report still only reads the first line ignoring anything after the 'OR'

I'm very confused
 
That should be:

not ({CnPrProp_1.CnPrProp_1_Status} in ["", "Identified", "Withdrawn"])

And since this has nothing to do with the first criteria you posted, the confusion spreads.

Please try to explain the requirements, you appear to be bouncing about..

-k
 
Apologies for the confusion.

I would like the report to suppress records if they meet one of three conditions:

1 - Proposal Status is not one of Identified or Withdrawn
2 - Date Funded is before 1st August, 2007
3 - Date Asked is befoe 1st August, 2007


not ({CnPrProp_1.CnPrProp_1_Status} in ["", "Identified", "Withdrawn"]) successfully suppresses those records for point 1.

However, my formula to suppress points 2 and 3 only reads the first line of the formula and ignores anything that follows 'OR'

Originally I had point 1 in the Select Expert and then placed my formula for 2&3 in the Section Expert ~> Details ~> Suppress x+2

My gut feeling is that the problem is with my formula rather than it's placement.
 
Please, post your entire formula(s) involved, and where they are located.

Discussing them is fine, but we need to see specifics.

-k
 
ok

In Select Expert

{CnPrProp_1.CnPrProp_1_Status} in ["Funded", "Pledged", "Rejected"]

In Section Expert -> Details -> Suppress -> x-2

{CnPrProp_1.CnPrProp_1_Date_Asked} <= DateTime (2007,07,31,00,00,00) OR
{CnPrProp_1.CnPrProp_1_Date_Funded} <= DateTime (2007,07,31,00,00,00)

If you need any more info please let me know.

Many, many thanks for all the time you're giving to this.

Pete

 
Your formula should work fine just as it is--unless either of these field can have nulls. But, as SV suggested, these should be in your record selection formula. Let's say that datefunded can be null. Change your record selection formula to:

{CnPrProp_1.CnPrProp_1_Status} in ["Funded", "Pledged", "Rejected"] and
(
{CnPrProp_1.CnPrProp_1_Date_Asked} > DateTime (2007,07,31,00,00,00) and
(
isnull({CnPrProp_1.CnPrProp_1_Date_Funded}) or
{CnPrProp_1.CnPrProp_1_Date_Funded} > DateTime (2007,07,31,00,00,00)
)
)

-LB
 
Please ignore my previous post, I pasted a formula from a different report which I had open.

The formula should read as follows:


In Select Expert
not ({CnPrProp_1.CnPrProp_1_Status} in ["", "Identified", "Withdrawn"])

In Section Expert -> Details -> Suppress -> x-2

{CnPrProp_1.CnPrProp_1_Date_Asked} <= DateTime (2007,07,31,00,00,00) OR
{CnPrProp_1.CnPrProp_1_Date_Funded} <= DateTime (2007,07,31,00,00,00)

If you need any more info please let me know.

Many, many thanks for all the time you're giving to this.

Pete
 
Try:

not ({CnPrProp_1.CnPrProp_1_Status} in ["", "Identified", "Withdrawn"]) and
(
{CnPrProp_1.CnPrProp_1_Date_Asked} > DateTime (2007,07,31,00,00,00) and
(
isnull({CnPrProp_1.CnPrProp_1_Date_Funded}) or
{CnPrProp_1.CnPrProp_1_Date_Funded} > DateTime (2007,07,31,00,00,00)
)
)

Please try this. You really should NOT use suppression unless necessary as it creates other complications. If you feel cannot use a record selection formula, please explain why.

-LB
 
Problem solved at last, many thanks for all the help on this thread.

Peter
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top