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!

Crystal Formula

Status
Not open for further replies.

golden1

Technical User
Sep 16, 2008
14
GB
Is it possible to create a formula to say,

if {Example} = "?" but <> "??" then etc... ?
 
A field cannot have two values in the same row, so I'm guessing you are really talking about including some GROUP where there is a row with the field = one value but no row containing some other value. Why not show some sample data that illustrates what you want to do?

-LB
 
If you want {Example} to equal something, then is there a reason you need it to not equal something at the same time? Meaning if you use an if/then statement, when you set {Example} equal to something, the 'then' part of the statement will only happen when the first part is satisfied. You wouldn't need a 'does not equal' part to do this.

As lbass said though, example data would help us help you.

-DJWW
 
Maybe you are trying to say

if {Example} = "?"
and {Example} <> "??"
then etc....

_____________________________________
Crystal Reports XI Developer Version
Intersystems Cache 5.X ODBC connection

 
Hi,
That is also redundant - If it is = "?" it is, by definition, <> "??".




[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
Yeah I spose your right huh? Not sure where my mind was going with that one.

_____________________________________
Crystal Reports XI Developer Version
Intersystems Cache 5.X ODBC connection

 
Thanks for all your responses. Here's an example of what i am trying to do.

My report shows all clients and different date types input for each client. There are 3 date types, ARD, IRD and LMD.I only want the report to show ARD & IRD dates.

All clients should have a date type of "ARD", so I need to see any clients that do not have an "ARD" type input. I cannot say "is null {date.type} as the client might also have date types of "LMD" or "IRD" and therefore wouldn't be blank.

I want to do something like this:

{DDATE.DDATE} = "LMD" or
{DDATE.DDATE} = "IRD" but
{DDATE.DDATE} <> "ARD"

Hope this makes sense!

Thanks
 
{DDATE.DDATE} <> "ARD"

will give you everything that is not ARD
or try

isnull({DDATE.DDATE}) = true or {DDATE.DDATE} in ["LMD","IRD"]

will give you anything that is null or anything that is LMD or IRD

_____________________________________
Crystal Reports XI Developer Version
Intersystems Cache 5.X ODBC connection

 
You need to allow all datetypes into the report (no record selection), and then insert a group on {table.client} and then create a formula in the field explorer->formula->new:

//{@hasARD}:
if {DDATE.DDATE} = "ARD" then 1

Then go to report->selection formula->GROUP and enter:

sum({@hasARD},{table.client}) = 0

Only clients without ARD will be displayed, regardless of other dates they may have.

-LB
 
That's great. Thank you for all your help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top