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 gkittelson 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 statements....HELP!

Status
Not open for further replies.

mwhalen

Programmer
Oct 31, 2000
217
CA
does anyone know why this will not work? I keep getting all renewcontracts.contractnum

If 0=StrCmp({_OrdContracts.ContractNum}, {_RenewContracts.ContractNum}, 0) Then
If 0<>StrCmp({_OrdContracts.ContractNum}, {_RenewContracts.ContractNum}, 0) Then
{_OrdContracts.ContractNum}
Else
{_RenewContracts.ContractNum}
Else
{_RenewContracts.ContractNum}
 
This is the net effect of your formula:

If 0=StrCmp({C}, {R}, 0) and 0<>StrCmp({C}, {R}, 0)
Then {C}
Else {R}

The first two conditions have to be true to get the first THEN, so they force you to one of the two ELSE statements.

What are you trying to do? Ken Hamady
Crystal Reports Training and a
Quick Reference Guide to VB/Crystal
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top