If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Crystal Reports > Re: Formulae update

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-22-09, 06:01
dr223 dr223 is offline
Registered User
 
Join Date: Jul 2009
Posts: 22
Re: Formulae update

Hallo,

I am working with VB.net 2005 and use crystal report on my application.
I have a Crystal Report formulae which works fine. However, I want to add more functionality. Presently the Discrete values on the Enter Parameter Dialogue box are;

ALL
Dr
Dr(Mrs)
Sister
Mr

What I want to do is when I select "Dr" the formulae pulls all the Dr & Dr(Mrs) at one time.....

Please could anyone tell me how I can achieve that.. Presently I have the following formulae which has no error but doesnt give the result

(if {?By Salutation} = "ALL" then TRUE
else {GP27.SALUTATION} = {?By Salutation}) or
(if {?By Salutation} = "Dr" then
{GP27.SALUTATION} = "Dr" and
{GP27.SALUTATION} = "Dr(Mrs)")


Thanks

Last edited by dr223; 07-22-09 at 07:19.
Reply With Quote
  #2 (permalink)  
Old 07-27-09, 15:39
trowe trowe is offline
Registered User
 
Join Date: Dec 2004
Location: Connecticut
Posts: 85
First of all - you just confused OR with AND ("OR" means it meets any of the conditions, "AND" means it must meet all of the conditions). Since a person can't be listed as "Dr" and "Dr(Mrs)" at the same time, setting the parameter to "Dr" yeilds no records. I've rearranged it so I could follow the logic easier and came up with this:

if {?By Salutation} = "ALL" then TRUE 'this selects everyone
else (if {?By Salutation} = "Dr" then
{GP27.SALUTATION} = "Dr" or {GP27.SALUTATION} = "Dr(Mrs)" 'this gets the Doctors - men and women
else {GP27.SALUTATION} = {?By Salutation} 'this catches everyone else

Second - Are these the only choices for a salutation? Haven't you heard of political correctness? In your case, these few may be acceptable for 99% of the people you'll deal with, but there's always that exception. A doctor can be a man or a woman, married or single. And a nurse can be a man or a woman and not necessarily a member of a religious order. A female doctor or nurse should have the choice to tell her marital status or religious affiliation or conceal it if she prefers.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On