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

Use Total in VB or figure on Crystal Report? 3

Status
Not open for further replies.

rtshort

IS-IT--Management
Feb 28, 2001
878
US
I am storing information for an estimate in a database. (each different line(hours, materials, & etc.))

Should I store the SubTotal, Tax, Hours, & etc in a related database to put on a Crystal report or should I use Crystal Reports to do the Calculations? Rob
Just my $.02.
 
Someone has to have an opinion on this?
Rob
Just my $.02.
 
My opinion: I come from the "old school" of no disk space, so my initial opinion is to calculate anything like that. I haven't found many compelling reasons to store calculated fields (I'd be interested in hearing them) so I tend to stay in that paradigm.

Kevin
 
I dont think you should store any calculated fields in a database.
 
I have one field that is NVarChar so I can put an Asterik (*) by the value if the user changes the default value. I can't figure out how to get the total in Crystal Reports with the Asterik present? Rob
Just my $.02.
 
Instead of an asterisk, why don't you add a boolean column, called ChangedFromDefault or something like that, and set it to True when the value is changed? That way you won't have to strip out the asterisk.

If you can't do that, you'll have to do a formula in Crystal that looks something like:

If Right({fieldname},1) = '*' then
ToNumber(left({fieldname}, length({fieldname}) -1))
else
ToNumber({fieldname})
(I didn't test this, you might have to fiddle with it a bit)

I'm with Klick, I wouldn't store a calculated value in the database. Let Crystal calculate it, that's what it's good at :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top