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!

dBASE expression

Status
Not open for further replies.

sandingdude

IS-IT--Management
Jun 26, 2002
109
US
I am attempting to add a field to one of the reports.

I was able to bring over the fields I need the only they are no calcuating the value I need.

I want it to do this calculation:

(2/5) *100 = 40


And on the report just put 40.

But inside its showing me the equation (2/5) * 100

Here is my expression:

(&syfield20"/"+&syfield12+)"*"+&100+

Did I forget the equals somewhere?

Thanks in advance.
 
At first I was going to tell you to try encapsulating the expression within the EVAL() function. I see you're using macrosubstitution and I don't think that last one (&100+) is correct. Try wrapping EVAL() around the appropriate pieces of the equation as follows and let us know if it works.

If syfield20 and syfield12 are numeric in character strings:

EVAL(syfield20)/EVAL(syfield12)*100

If syfield20 and syfield12 are numeric:

syfield20/syfield12*100

While I don't think it necessary, if the above doesn't work, then also wrap the entire expression in an EVAL().

Remember to never let syfield12 be zero or you'll get a divide by zero error!

dbMark
 
Thanks for the help. I will try it this afternoon.
 
Hi dbMark

I tried the equation and I received the following error:

Invalid function or Dot Operator: EVAL

Any ideas?
 
Hi dbMark

I'm looking at the functions that goldmine lets me use and eval is not in the list.

I got a little further with this though:

When I put the following expression in:
int(&syfield20) it will display the appropriate vvalue for that field ex. 28

when i do the following:

int(&syfield20)/int(&syfield12)*100

28/56*100

It will display a 0 on the report. Any ideas?
 
Hi dbMark

I got the expression to work

Here is what I came up with:

(int(&syfield20)*100)/int(&syfield12)

The only thing I need to do is display the % sign next to the computed value. I have no idea how to do this. Also I can't get the computed value to give me a decimal answer. There is a function in goldmine called "double(" Which converts to a decimal number,but it didnt seem to work since I need to compute the computed value into a decimal.

Any ideas?

Thanks again.

Dave
 
I'm not familiar with goldmine so that may be why my suggestion didn't work.

If this won't work in goldmine ...
EVAL((int(&syfield20)*100)/int(&syfield12))

then how about placing the entire expression within just ( ) ...

((int(&syfield20)*100)/int(&syfield12))
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top