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

String Error in formula

Status
Not open for further replies.

ncchish

Programmer
Jul 29, 2002
86
US
I'm using CR 11. I have a formula:

//@QTRVAR

If {@QPlan} = 0 Then
0
Else
(({@QTD}-{@QPlan})/{@QPlan}) * 100

Then I have another formua that evaluates @QTRVAR

//@QTRVAR2

if {@QtrVar} > 999 then "NM" else {@QtrVAR}

I get 'string required here for the second formula. I need to display NM if QTRVAR is > 999. Any ideas?

Thanks.

 
Both results of an if then else statement must be of the same datatype (For example both numeric or strings).

As a short term solution a simple fix would be:

if {@QtrVar} > 999 then "NM" else totext({@QtrVAR})

If this value is needed at a later point then you can either refer to the original value or use an alternative formula to adjust on the basis of value only.

'J
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top