Viewing 15 posts - 1 through 15 (of 15 total)
I started this thread 2 year ago. And it still seems to be actual.
For all this time I'm using the following funtions for banker's rounding and seems it work great:
[font="Courier...
October 9, 2007 at 1:54 am
Tyson, as I see your script is not using banker's rounding. ROUND - uses traditional arithmetic (5 always is rounded up).
If you are rounding only on DB level it's better to...
January 6, 2006 at 5:14 am
I've investigated it: seems like that's due to inaccuracy with double - very small amounts (like 0.0000000005) are added while calculating. So, I think it' s problem with double calcualations....
January 5, 2006 at 10:52 am
Also, I've found "banker's" round in VB from Microsoft
http://support.microsoft.com/default.aspx?scid=kb;EN-US;196652
I've translated it to T-SQL, here it is:
create function BankRoundDotNet (@val as numeric(30,15), @factor as int)
returns money
as
begin
declare @result double...
January 5, 2006 at 9:38 am
Jeff, you are right - STR behaves like Math.Round in .NET. But I found one exception I can't explain:
In .NET:
Math.Round(40.645161290322584,2) --> 40.65
Math.Round(41.645161290322584,2) --> 41.65
Math.Round(40.645,2) --> 40.65
Math.Round(41.645,2) --> 41.64
STR in SQL:
select...
January 5, 2006 at 9:26 am
Jeff, STR seems to round only last digit before precision. It doesn't take into account digits to the rigth.
Try this number: 3.4546
banker's round -> 3.46
STR -> 3.45
December 29, 2005 at 3:09 am
Thank you Carl!!! That's what I need.
December 27, 2005 at 10:48 am
That's realy baker's rounding but with one weakness - it rounds only one digit before precision digit.
For instance: rounding of 3.445657545 to second digit after dot takes no account...
December 26, 2005 at 10:43 am
Thanks Jeff. But none of them is banker's rounding.
Banker's rounding bahaves like arithmetic rounding with one exception: if value is halfway between two numbers, one of which is even and...
December 26, 2005 at 3:56 am
There is enough free space on destination disk.
I tried to create maintenance plan only for those 2 database but it failed with the same error
September 2, 2005 at 8:43 am
I've got both letters. I tried a lot of variants to solve this issue.
Of course all folders exist.
September 2, 2005 at 7:09 am
In Enterprise Manger select all stored procedures and choose All Tasks->Generate SQL Script in context menu. It'll generate SQL-script to text file. Run this script on the destanation server.
Also...
September 2, 2005 at 3:33 am
I'm backuping to network machine on it's HDD.
Symantec antivirus is running on the destanation machine.
Event Log contains next errors :
3041 : BACKUP failed to complete the command BACKUP...
September 2, 2005 at 1:55 am
SQL Server's & SQL Server Agent's accounts have Administrator's rights on both machines.
September 2, 2005 at 1:48 am
All backups are being made to the same location.
I've created one maintenance plan for 6 databases. So, they are backuped within one job.
When I run the job it...
September 1, 2005 at 11:45 am
Viewing 15 posts - 1 through 15 (of 15 total)