Solved

# silly question re DECIMAL

Posted on 2009-12-31
219 Views
what is the EXACT  decimal value for '100', or 100 % ?
0
Question by:dbaSQL

LVL 17

Author Comment

more detail, they need to write a 'percentage' value to a table.  having all sorts of problems w/the datatype (decimal(5,3)

0
.50
1
10.25
50
75.9
100

just looking for the best way to define the attribute
0

LVL 75

Accepted Solution

> (decimal(5,3)
it should be decimal(6,3 )
0

LVL 75

Expert Comment

decimal (5,3) can store upto 99.999 while decimal (6,3) can store upto 999.999
0

LVL 17

Author Comment

and the correct way for them to give me 100 ?  (100 %)
0

LVL 17

Author Comment

just 100, right?

declare @1 = decimal(6,3)
set @1= 100
select @1  = '100.000'

yes?
0

LVL 17

Author Comment

yep.   thank you, aneesh
0

## Featured Post

In this article I will describe the Backup & Restore method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function