Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Formula with multiple criteria if/then/else Post Reply Post New Topic
Author Message
miamitourism
Newbie
Newbie
Avatar

Joined: 14 Jan 2011
Online Status: Offline
Posts: 24
Quote miamitourism Replybullet Topic: Formula with multiple criteria if/then/else
     Posted: 12 May 2011 at 9:42am
Hi forum! I hope you can help a newbie out on this one.  I have a database with many tables, two of which I am using for this report.  The table called IP.Minor_Code holds many codes for each Member of my company, but I am only interested in two codes: "CERTGREEN" and "ENVIRONF" for a report I am building that will show a list of Members, and whether they are "CERTGREEN" (Certified Green Lodging Hotel) or "ENVIRONF" (Environmentally Friendly), or both.  I need each line of data to look like this:
 
Member Name | Address | #Rooms | CERT? | ENVIRONF?
 
The problem that I am having is that the select expert formula is looking for those two codes, CERTGREEN and ENVIRONF:
{ip_Major_Codes.major_code} = "A" and
{cli_Clients.ip_status} in ["MEMBER", "NONMEMIP"] and
{ip_Minor_Codes.Minor_Code} in ["CERTGREEN", "ENVIRONF"]
 
So, each Member record is showing twice.  I need it to show only once, and if the member is CERTGREEN, then I need it to place a "Y" in the column under the CERT? heading, and if it's ENVIRONF, I need it to place a "Y" in the ENVIRONF? column. Better yet, rather than using "Y"s in each of those columns, if you can tell me how the heck I can tell it to put a check mark there instead, that would be phenomenal, and I would bow to the great formula guru who is YOU. Shocked ANY SUGGESTIONS?
IP IP Logged
comatt1
Senior Member
Senior Member
Avatar

Joined: 19 May 2011
Online Status: Offline
Posts: 337
Quote comatt1 Replybullet Posted: 19 May 2011 at 9:40am
When we want to put checkmarks in we set the text of the field with WINGDINGS font.

For a checked box we use
chr(254) and unchecked box chr(168)

if your case you would setup a formula for the associated field and then have

if <<CERT?>> = 'Y' then chr(254) else chr(168).

I think this is what you were asking -- atleast the second part of it.
IP IP Logged
miamitourism
Newbie
Newbie
Avatar

Joined: 14 Jan 2011
Online Status: Offline
Posts: 24
Quote miamitourism Replybullet Posted: 19 May 2011 at 10:06am
OMG! Checkboxes!!?!? Awesome!!

Now, the only thing I would need to know is how to avoid each record printing twice, and rather, just placing a check in the appropriate column.
 
Let's see if I get any ideas....
 
Thanks for your help! I'll be using that checkbox thing OFTEN!
IP IP Logged
comatt1
Senior Member
Senior Member
Avatar

Joined: 19 May 2011
Online Status: Offline
Posts: 337
Quote comatt1 Replybullet Posted: 19 May 2011 at 10:20am
If you group by member name and only list the information in the gf, you shouldnt see multiple records if you just suppress the details section.

IP IP Logged
Dewald
Groupie
Groupie
Avatar

Joined: 02 Jun 2011
Location: South Africa
Online Status: Offline
Posts: 47
Quote Dewald Replybullet Posted: 03 Jun 2011 at 12:32am
Thanks for the Checkbox idea.
Brilliant
 
Dewald Botha
http://www.ITClarity.co.za
IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum