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

How do I add 2 number fields together (per record) 1

Status
Not open for further replies.

RCCRookie

Technical User
Jul 3, 2007
29
US
Crystal XI; SQL 2000 DB
I would like to total two number fields per record (labor cost + material cost). The SUM function doesn't seem to be what I'm looking for and I can't find an ADD function. (I'm new enough and dumb enough to think it could be that easy... as if!) I'm sure there is a way to accomplish this but I'm stuck. Can anyone help?
 
Nevermind...I seem to have found the Add operator. It isn't working for me yet but at least it's a start. For some reason I wasn't able to find it using search under HELP. If at first you don't succeed... try, try again.
 
Entering soemthing like {labor_cost} + {material_cost} from a formula field should work. You ought to see the names of the field in one of the sub-windows and can click on the name to include it.

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
The reason it wasn't working initially is because I wasn't taking nulls into account. I created formulas for both material and labor costs so that if null or empty string it would display a 0. I then used the ADD operator with the formulas and it works as expected. Yeah!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top