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

if then else staement?

Status
Not open for further replies.

abhishekpant

Programmer
Dec 21, 2004
38
0
0
US
I am using acess and crystal report 10
I have few question……

1.I have some of these table in a query

Member Associate tier type
Chase bankone 1 G
Citibank Sears 2 P
Xyz no value assign 3 no value assign


And so on… Citibank has many associate like sears,baramax.
1.So in my selection of the client name I want to see Citibank instead of sears or baramax or so;….

2. if type is “g” then value of tier is “GKA” else value of tier are 1,2 or 3

So when I am using the if then else statement then it is showing the Boolean value
and after that i have to make the group using the value of tier i.e GKA,tier1,tier2,tier3

can anyone help
Abhishek
 
Since english isn't your first language, you'd be better served to post technical information rather than trying to describe the concern:

Database/connectivity used
Example data
Expected output as a result of the example data

Also if you are using formulas, post the formula, not a pseudo version of it.

It sounds like you're trying to create groupings to me based on an if statement.

If I understand it correctly, you'd want a formula containing:

(2. if type is “g” then value of tier is “GKA” else value of tier are 1,2 or 3)

if {table.type = "g" then
"gka"
else
"tier"&{table.tier}

Now use insert group on this formula.

-k
 
thanks for the tips for submitting a post

Access/cr 10

Data on the table.

Member Associate tier type
Chase bankone 1 G
Citibank Sears 2 P
Citibank baramax 2 p
Xyz (blank) 3 (blank)

I the type field if data is blank than it should show others
and it should follow the rule for "gka"

expected data

client name tier
Chase GKA
Citibank 2
Xyz 3

i think this time i am more clear

abhishek

 
A bit clearer, except when you try to describe it.

This sentence doesn't make sense "I the type field if data is blank than it should show others and it should follow the rule for "gka""

Are yuo saying that either a G or a blank in the type field should be GKA?

If so, try:

if isnull({table.type})
or
trim({table.type}) = ""
or
{table.type} = "G" then
"gka"
else
{table.tier}

If the tier field is a numeric, change the formula to:

if isnull({table.type})
or
trim({table.type}) = ""
or
{table.type} = "G" then
"gka"
else
totext({table.tier})

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top