[Sussex] query problems and rounding

Alex Craddock nakories at gmail.com
Wed Jul 13 13:26:20 UTC 2005


I would think it is looking past the 5th digit and for the 26.775
possibly seeing it as 26.7754 and therefore rounding down

and the other as 

95.2756 so rounding up

I cant find a function to roundup or rounddown with access, there is
one but it only works for excel :/.

The only other thing you could try if you always want it rounded up is
add 0.0005 to the equestion that might solve the problem....


On 7/13/05, Gareth Ablett <Gareth.Ablett at itpserve.co.uk> wrote:
> All,
> 
> Ok this isn't exactly Linux related as I have to do it with ACCESS (the
> devil in a database) but knowing the depth of brain power and knowledge
> here on the list it only wise to ask when I cant find much else out
> about the problem.
> 
> I have a query like so;
> 
> SELECT ROUND( (salary1/100*3/12), 2) FROM ....... (you don't need to
> know the rest)
> 
> When salary1 = 10710 the answer without rounding is 26.775 but when
> rounded it = 26.77
> 
> When salary1 = 38110 the answer without rounding is 95.275 but when
> rounded it = 95.28
> 
> The result being that one rounds correctly and the other doesn't.
> My first idea was that access implements bankers rounding but then
> noticed that it was not always on even numbers.
> 
> 
> Any insight at all would be very helpful
> 
> Gareth Ablett
> Systems Developer
> 
> ITP Services Ltd.
> http://www.itpserve.co.uk/
> 
> ------------------------------------------------------------------------
> The recipient acknowledges that ITP Services Ltd is unable to control
> the content of information in transmitting mail and attachments over the
> Internet. ITP Services Ltd makes no warranty as to the quality,
> accuracy and content of information contained in or with this message.
> In
> reading, opening or receiving this e-mail the recipient accepts full
> responsibility for its content and attachments.
> 
> 
> _______________________________________________
> Sussex mailing list
> Sussex at mailman.lug.org.uk
> Sussex LUG Website: http://www.sussex.lug.org.uk/
> http://mailman.lug.org.uk/mailman/listinfo/sussex
>




More information about the Sussex mailing list