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

Initialize money field with zeroes or leave empty?

Status
Not open for further replies.

lorirobn

MIS
Mar 15, 2005
450
US
Hi,

I have a money field on one of my tables (linked to SQL server). This field is empty on about half the rows.

Is it better to keep the field null when empty, or initialize it with zeroes? Is one method more efficient for storage?

Thanks in advance,
Lori
ps - I posted this on another forum yesterday, but this forum may be more appropriate
 
Nulls take up less space than zeros, but the space savings is not important compared to accurately representing what is happening with the data. Let's take as an example an invoice. The invoice header has info about the customer, the shipping address, the payment method, etc. In addition, it has three money fields, shipping and handling, sales tax, and total amount invoiced.

Now, let's look at what zeros and nulls mean. Let's say you are in a state with no sales tax, like Delaware. Would you want to enter zeros or null (empty) for the tax? How about if the customer was a non-profit organization and is thus tax-exempt? How about if the customer is a wholesaler and thus exempt from tax (in America, sales taxes are only paid by the end user, not the middleman)? How about if the customer is from overseas and is exempt from state and local taxes?

see thread701-1229417 for some ideas

-------------------------
The trouble with doing something right the first time is that nobody appreciates how difficult it was - Steven Wright
 
Excellent examples - thanks so much. The thread you sent me to was also helpful.

I now believe zeroes are the appropriate choice for my situation, and will not lose sleep worrying about the space I use up with zeroes on 400 records!

Many thanks,
Lori
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top