Re: a problem
From: Bojidar Alexandrov (bojo_do_not_spam_at_kodar.net)
Date: 11/11/04
- Next message: David Portas: "Re: COLUMNS_UPDATED and large tables"
- Previous message: johndoe_at_driver.net: "Re: Full Text Indexing on Microsoft SQL Server 2000 with Windows XP Pro"
- In reply to: a.k.a CyberPunk: "a problem"
- Next in thread: a.k.a CyberPunk: "Re: a problem"
- Reply: a.k.a CyberPunk: "Re: a problem"
- Reply: a.k.a CyberPunk: "Re: a problem"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 11 Nov 2004 09:19:26 +0200
"a.k.a CyberPunk" <akaCyberPunk@discussions.microsoft.com> wrote in message
news:91253825-76EA-4A91-9A6C-137F72303A28@microsoft.com...
> Aaron, I meaning no disrespect, but i still have a problem
> this works gives 34.25, 34.5
> declare @myvalue NUMERIC(6,2)
> set @myvalue = 34.443388
Here you declare precision of 6 with 2 decimal places. Then assign a number
with precision of 8 with 6 decimal places so it gets rounded here.
Try to do this and will see.
declare @myvalue NUMERIC(6,2)
set @myvalue = 34.443388
select @myvalue
So you have not mentioned what is precision of your input data, is it fixed?
With this concrete example you can use
declare @myvalue NUMERIC(18,8)
set @myvalue = 34.443388
select round(@myvalue * 4, 0, 1)/4.0
Bojidar Alexandrov
- Next message: David Portas: "Re: COLUMNS_UPDATED and large tables"
- Previous message: johndoe_at_driver.net: "Re: Full Text Indexing on Microsoft SQL Server 2000 with Windows XP Pro"
- In reply to: a.k.a CyberPunk: "a problem"
- Next in thread: a.k.a CyberPunk: "Re: a problem"
- Reply: a.k.a CyberPunk: "Re: a problem"
- Reply: a.k.a CyberPunk: "Re: a problem"
- Messages sorted by: [ date ] [ thread ]