Print Page | Close Window

subtract two fields

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Technical Questions
Forum Discription: Formulas, charting data, Crystal syntax, etc.
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=225
Printed Date: 28 Apr 2024 at 10:55pm


Topic: subtract two fields
Posted By: liher
Subject: subtract two fields
Date Posted: 20 Feb 2007 at 8:40am
Hello!
Im newbie too in crystal reports hehe and I would like to create a formula to sustract two fields of a access file.
I tried something like:
 {Calibracion.PATRON_01} - {Calibracion.ELEMEN_01}
 
but not working...
 
Can someone make me this small formula?
 
thanks in advance



Replies:
Posted By: BrianBischof
Date Posted: 20 Feb 2007 at 9:11am
Well, we need more info about what is not working. It appears to be a simple function which you have written correctly. Does it give you the wrong result, does it give an error message of some sort?

-------------
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>


Posted By: liher
Date Posted: 20 Feb 2007 at 9:23am
yes, it says "a number, currency amount, date, time, or date-time is required here"
 
I dont know if I am doing the formula in the right place. I tried in CSS Class Name clicking in X+2


Posted By: BrianBischof
Date Posted: 20 Feb 2007 at 10:07am
Well, I think you need to read some of the chapters in my free online book. This is getting a bit confusing. The CSS Class Name is for formatting the output. I don't think this is what you want? You need to create a new formula in the Field Explorer window and then drag and drop that formula onto your report to view it.

-------------
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>


Posted By: liher
Date Posted: 20 Feb 2007 at 11:43pm
I created a formula in the Field Explorer window, now it shows a result but only when I use Operators -> Arithmetic -> Add. When I use Subtract I get the same error.
The field numbers are in this format   00149,16


Posted By: liher
Date Posted: 22 Feb 2007 at 3:03am

finally I did it without any knowledge

tonumber({Calibracion.PATRON_01}) - tonumber({Calibracion.ELEMEN_01})




Print Page | Close Window