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

Comparing data to different parameters based on value 1

Status
Not open for further replies.

Alicia159

Technical User
Jun 14, 2004
5
US
Hello,

I am hoping that someone can help me out here. I am trying to put together a report that will compare data to different parameters depending on the value of the data. For example:
Fields: Tier, Rate and 4 parameter fields
Tier has four values, 1-4.

I want to have everything that has a Tier value of 1 compare it's rate field to Parameter 1. Tier values of 2 should compare the rate field with Parameter 2....etc. The ultimate result being that the report shows all items that DON'T match their parameters.

I think that I can do this with a SQL expression but I am not sure if I can use the parameters set in Crystal for this or if I need to set up the Parameters somewhere else.
 
Still a bit muddy for me, please post technical information when requesting it:

Crystal version
Database used
Example data
Expected output

It sounds like you'll want to create the 4 parameters, and then in the Report->Edit Selection Formula->Record use something like:

not(
(
{table.tier} = 1
and
{table.rate} = {?rateparm1}
)
)
and
not(
(
{table.tier} = 2
and
{table.rate} = {?rateparm2}
)
)
and
not(
(
{table.tier} = 3
and
{table.rate} = {?rateparm3}
)
)
and
not(
(
{table.tier} = 4
and
{table.rate} = {?rateparm4}
)
)

Since you want those items that aren't matches, use the NOT function.

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top