Re: Someone write a BankersRound UDF...
From: Ian Boyd (ian.msnews010_at_avatopia.com)
Date: 08/13/04
- Next message: anonymous_at_discussions.microsoft.com: "Re: I need a bug fix for KB 290817 - anyone know how/where to get?"
- Previous message: Steve Kass: "Re: Resticting No of entries"
- In reply to: Steve Kass: "Re: Someone write a BankersRound UDF..."
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 13 Aug 2004 10:19:42 -0400
> See if this works for you:
>
> case when d = floor(d) then d else
> case sign(ceiling(d) - 2*d + floor(d))
> when 1 then floor(d)
> when -1 then ceiling(d)
> else 2*round(d/2,0) end
> end
>
> If you put the expression (this one or one that works) inline instead of
> as a user-defined function, it will likely be faster. There is some
> chance of overflow here, but not until you deal with very large amounts
> of money.
Thanks Steve. It seems to work :)
i definetly would rather have it as a function. The last buggy routine was
easy to fix, since it was a UDF that i only had to change in the one spot.
- Next message: anonymous_at_discussions.microsoft.com: "Re: I need a bug fix for KB 290817 - anyone know how/where to get?"
- Previous message: Steve Kass: "Re: Resticting No of entries"
- In reply to: Steve Kass: "Re: Someone write a BankersRound UDF..."
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|