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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Conditional record selections on multiply parameters for crystal

Status
Not open for further replies.

IanMWheeler

Technical User
Jul 28, 2009
16
GB
Hi there

I run a cut down version of crystal in a program call syspro known as SRS

I have a report with multiple parameters and wish to make selections based on these, the problem I have is that the first selection formuala works but the remainding selection formuals do not - so I guess the problem is in the way I am joining the formula. The record selection formula is:

if {?Area} ='All' then ({CHCIW_ShippingOrdersView.Area} like '*') else ({CHCIW_ShippingOrdersView.Area} = {?Area} )
and

If {?ReadyToDesp}='D' then ({CHCIW_ShippingOrdersView.DespStock}>0) else (
{CHCIW_ShippingOrdersView.DespStock}>=0 )
and

if {?Cust} = 'All' then ({CHCIW_ShippingOrdersView.Customer} like '*' ) else ({CHCIW_ShippingOrdersView.Customer}={?Cust})

and

if {?DateTo} =#01/01/1900# then ({CHCIW_ShippingOrdersView.MLineShipDate} < dateadd('d',6,CurrentDate)) else ({CHCIW_ShippingOrdersView.MLineShipDate} <= {?DateTo})

can any one help please?

A person new to crystal with very little training a part from Access based

Regards
Ian
 
You could add brackets. I'm also unsure what you mean by if {?Area} ='All' then ({CHCIW_ShippingOrdersView.Area} like '*')

A better method is to separate off the sections into separate Formula fields. E.g.
Code:
{?Area} ='All' 
or
{CHCIW_ShippingOrdersView.Area} = {?Area}
If you display @AreaCheck with the data, it should show True or False, and always True when Area is "All". (Assuming that's what you want.)
Once you have developed the individual tests, you can combine them in the record selection, e.g.
Code:
@AreaCheck and @DespCheck and @CustCheck and @DateCheck

[yinyang] Madawc Williams (East Anglia, UK). Using Crystal 11.5 with SQL and Windows XP [yinyang]
 
Hi there Madawc

Thanks for the tip, I did get the brackets working, but I can see your method is cleaner and easier to build, I shall add it to my report

Many Thanks

A person new to crystal with very little training a part from Access based

Regards
Ian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top