[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

What data type do I use for decimal numbers?

Posted on 2005-05-11
5
Medium Priority
?
241 Views
Last Modified: 2010-03-19
I have an ASP app that need to be able to enter 0.25, 0.5, 0.75 into a SQL database. What data type do I use for that and anything to watch out for?

I have tried all the types and I can't seem to get it today.

Any ideas?
0
Comment
Question by:cjinsocal581
  • 3
  • 2
5 Comments
 
LVL 28

Expert Comment

by:rafrancisco
ID: 13979938
You can try using DECIMAL(3,2).

What do you mean when you say "I have tried all the types and I can't seem to get it today".
0
 
LVL 6

Author Comment

by:cjinsocal581
ID: 13979964
changed the data types
0
 
LVL 6

Author Comment

by:cjinsocal581
ID: 13979985
Will this affect my exisiting data that I have?

In other words, in addition to the decimal numbers, I have 0-20 as well.
0
 
LVL 28

Accepted Solution

by:
rafrancisco earned 2000 total points
ID: 13980020
If you have 0-20, then use DECIMAL(4,2).  This means that the total number of digits that your column will accept is 4, 2 of which are decimal numbers.  The maximum number that your column can hold is 99.99.
0
 
LVL 6

Author Comment

by:cjinsocal581
ID: 13980294
Perfect.
0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Question has a verified solution.

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

Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.
Suggested Courses

872 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