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

IIf in a formula field and Group

Status
Not open for further replies.

nnaacc

Technical User
Mar 1, 2000
18
US
I'm using CR 8.0
I've got three tables:
buyers =* orders *= sellers
Every order has a buyer or a seller, but not always both.
I filter for a certain client - either as a buyer or seller.

I need to sort by the client order type, which is located on the buyer or seller table (depending on whether the client is the buyer or seller). I created a formula field called type, which is then used as a group name field.

It works fine when there is a buyer AND a seller but
the type returns null when there is only one - a buyer OR seller.

Here is the formula field:
IIf(
{Buyer.Client}={?Client},
{Buyer.Type},
{Seller.Type}
)

Thanks in advance for any help!
 
This should work around the problem - you may also want to test for a null value for {Buyer.Client}.
If {Buyer.Client}={?Client} then
(
If Not IsNull({Buyer.Type}) then
{Buyer.Type}
Else
"Null Buyer"
)
Else
(
If Not IsNull({Seller.Type}) then
{Seller.Type}
Else
"Null Seller"
)
Malcolm Wynden
I'm for sale at malcolm@wynden.net
 
Thank you Malcolm!

It works!

After a few months of use, I've found Crystal Reports to be a terrific program, and this forum has been VERY useful as I learn more. Thanks to everyone for the posts.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top