Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Selection operators on boolean key pairs? Post Reply Post New Topic
Author Message
Maahes
Newbie
Newbie
Avatar

Joined: 26 Sep 2008
Location: United States
Online Status: Offline
Posts: 8
Quote Maahes Replybullet Topic: Selection operators on boolean key pairs?
     Posted: 04 Feb 2009 at 10:08am
I am having an issue getting a fairly simple comparison operation on sql tables working, because I am not sure exactly how Crystal does its syntax for this.

What I have is 3 Address fields, and a boolean field called preferred_mailing. What I want is basically this in psuedo code:

If Address_1 is the preferred_mailing
     print Address_1
else if Address_2 is the preferred_mailing
     print Address_2
else print Address_3

Does anyone know how to do this kind of comparison with SQL tables in CR9?

EDIT: Nevermind, The Address Fields weren't what I thought they were. I was instead able to make a different report



Edited by Maahes - 04 Feb 2009 at 11:08am
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 04 Feb 2009 at 10:36am
What exactly do you have in your table? Sounds  like you have 4 columns: Address_1, Address_2, Address_3 and a preferred column...
Please explain how the preferred column indicates which of the other 3 columns it is.
If you have a preferred option per adress column it would be something like:
if table.preferred1field=true then table.address1 else
if table.preferred2field=true then table.address2 else
if table.preferred3field=true then table.address3 else
'Missing Preferred address text here' (this last else is optional to capture instances where none of the above are true, otherwise it would be an empty string).
 
 
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