Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > SQL Server > SQL Server 2000 > SQL Server 2000
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
SQL Server 2000 General discussion of Microsoft SQL Server -- for topics that don't fit in one of the more specific SQL Server forums. version 2000 only. There's a new forum for SQL Server 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server 2000 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old September 22nd, 2005, 06:32 AM
Authorized User
 
Join Date: Sep 2004
Location: , , .
Posts: 36
Thanks: 0
Thanked 0 Times in 0 Posts
Default working with money values in sql server

Hi,

I'm not used to working with the money values.

Can you tell me the best way to store salaries(£) in a DB?

I'm using the int datatype at the moment, but I'm having trouble entering values into my db, 8,000 enters as 80,000.

TIA

Reply With Quote
  #2 (permalink)  
Old September 22nd, 2005, 06:55 AM
Authorized User
 
Join Date: Sep 2005
Location: , , .
Posts: 95
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Use money or float

http://sqlservercode.blogspot.com/
Reply With Quote
  #3 (permalink)  
Old September 22nd, 2005, 05:25 PM
Authorized User
 
Join Date: Jul 2003
Location: , , .
Posts: 60
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to merediths
Default


 I like to use DEC(9,3)for money types. That's somewhat arbitrary, but I started using it when I had to develop some stuff that took a datafeed from a major securities rating company, so I figured it was credible based on that.

Regards,
Meredith Shaebanyan

Reply With Quote
  #4 (permalink)  
Old September 29th, 2005, 08:15 PM
Friend of Wrox
 
Join Date: Aug 2004
Location: Orange County, CA, USA.
Posts: 385
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I think Money, numeric or Dec work but I disagree with another above. I would NOT use float. Float is an aporximate value. You can get into situations where you stored 12.34, but what you get returned is 12.33. Although that data type does save space and have a lot of flexibility it can cause slight variations in what you saved vs what was returned and displayed to you users. It is also a common problem in accurate detailed calculations.

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
rounding up SqlDbType.Money TYPE in sql server olambe BOOK: ASP.NET Website Programming Problem-Design-Solution 2 December 9th, 2005 04:46 PM
geting money type from sql msrnivas Classic ASP Components 1 July 19th, 2004 11:09 AM
geting money type from sql msrnivas .NET Web Services 1 July 19th, 2004 06:36 AM
How Can SQL Server working with ASP??? aliasp SQL Server ASP 1 March 18th, 2004 03:13 PM



All times are GMT -4. The time now is 11:32 PM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.