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

formula problem

Status
Not open for further replies.

evilmousse

Programmer
Apr 15, 2003
85
US
argh, this makes no sense, the following code won't run:

if Sum ({procSoldLoansConfByInvRpt;1.Loan Amt})>0
then
sum({procSoldLoansConfByInvRpt;1.Spread}) / Sum ({procSoldLoansConfByInvRpt;1.Loan Amt})
else
0

i get an error Sum ({procSoldLoansConfByInvRpt;1.Loan Amt}) is not a number

so sum(a) / sum(b) won't compile.

but i HAVE compiled
sum(b) / sum(a)
and
sum (a) + sum(b)

so what the heck?!?!?
 
Where are you placing this formula?

Also, what is the data type of {procSoldLoansConfByInvRpt;1.Loan Amt} ?

FInally, what do you mean by "Won't compile" ? This is new terminolgy to me in regards to Crystal reports.

Software Sales, Training, Implementation and Support for Exact Macola, eSynergy, and Crystal Reports
 
spread is a calculated value in the query (decimal to 3
places), loan amt is money.

when i said won't compile, i referred to the fact that i
can't save the formula field without it prompting when i try to save, "there is a syntax error with the formula",
then point me to the donominator citing 'value must be
numeric'.

what really irks me is that the problem is not
reflexive.. ie the sum(b)/sum(a) i mentioned above works,
but my sum(a)/sum(b) doesn't.

-g
 
wrapped the loanamt denominator in a cdbl() function and it worked.

what the heck ever. thppppt.

-g
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top