Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

sql data types

Posted on 2014-01-27
6
Medium Priority
?
392 Views
Last Modified: 2014-01-27
hi, what is the ideal data type in sql 2005 to store numbers and half numbers, like 1,1.5,2,2.5 etc...?
0
Comment
Question by:bfuchs
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 85

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 700 total points
ID: 39813637
The Decimal type is always a good choice.
0
 
LVL 75

Assisted Solution

by:Aneesh Retnakaran
Aneesh Retnakaran earned 100 total points
ID: 39813647
numeric(5,1)
0
 
LVL 16

Assisted Solution

by:Surendra Nath
Surendra Nath earned 200 total points
ID: 39813662
decimal(18,2) will be a good fit
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 4

Author Comment

by:bfuchs
ID: 39813679
hi, by default it comes as decimal(18, 0), what are those values in parenthesis?
also i had it currently stored all as int, is it safe to just change the data type manually?
0
 
LVL 16

Assisted Solution

by:Surendra Nath
Surendra Nath earned 200 total points
ID: 39813691
the decimal data type is defined as below
decimal(p,s)

p--> precision (total number of digits in the number including the fractional numbers)
s--> scale (total number of fractional numbers)

More about this can be found here
http://msdn.microsoft.com/en-us/library/ms187746.aspx

Yes, it is safe to convert Int to decimal ( but not the other way around)
0
 
LVL 4

Author Closing Comment

by:bfuchs
ID: 39813766
Hi experts,
Not sure if I am awarding properly the points here:)
Will use the decimal option since the majority here are for it.
Really appreciate your quick responses,
Ben
0

Featured Post

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes two methods for creating a combo box that can be used to add new items to the row source -- one for simple lookup tables, and one for a more complex row source where the new item needs data for several fields.
Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

722 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question