<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: How to round to the nearest whole multiple or fraction in SQL</title>
	<atom:link href="http://www.xaprb.com/blog/2009/08/09/how-to-round-to-the-nearest-whole-multiple-or-fraction-in-sql/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.xaprb.com/blog/2009/08/09/how-to-round-to-the-nearest-whole-multiple-or-fraction-in-sql/</link>
	<description>Stay curious!</description>
	<lastBuildDate>Thu, 09 Feb 2012 20:41:20 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: Beverley M</title>
		<link>http://www.xaprb.com/blog/2009/08/09/how-to-round-to-the-nearest-whole-multiple-or-fraction-in-sql/#comment-17630</link>
		<dc:creator>Beverley M</dc:creator>
		<pubDate>Wed, 20 Jan 2010 21:53:44 +0000</pubDate>
		<guid isPermaLink="false">http://www.xaprb.com/blog/?p=1214#comment-17630</guid>
		<description>Ah, perfect, thanks!  I have a line graph that displays millions of dollars.  I wanted to set the Y axis to the farthest multiple of $50m over and under the current day&#039;s value.  This did the trick niceley, and now I don&#039;t have to manually update and hard code the axis min &amp; max every few months.</description>
		<content:encoded><![CDATA[<p>Ah, perfect, thanks!  I have a line graph that displays millions of dollars.  I wanted to set the Y axis to the farthest multiple of $50m over and under the current day&#8217;s value.  This did the trick niceley, and now I don&#8217;t have to manually update and hard code the axis min &amp; max every few months.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Generating numbers out of seemingly thin air &#124; code.openark.org</title>
		<link>http://www.xaprb.com/blog/2009/08/09/how-to-round-to-the-nearest-whole-multiple-or-fraction-in-sql/#comment-16909</link>
		<dc:creator>Generating numbers out of seemingly thin air &#124; code.openark.org</dc:creator>
		<pubDate>Tue, 01 Sep 2009 06:39:13 +0000</pubDate>
		<guid isPermaLink="false">http://www.xaprb.com/blog/?p=1214#comment-16909</guid>
		<description>[...] other day, Baron Schwartz posted How to round to the nearest whole multiple or fraction in SQL. In an offhand way, he generated some random numbers using the mysql.help_topic table. I then [...]</description>
		<content:encoded><![CDATA[<p>[...] other day, Baron Schwartz posted How to round to the nearest whole multiple or fraction in SQL. In an offhand way, he generated some random numbers using the mysql.help_topic table. I then [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: n</title>
		<link>http://www.xaprb.com/blog/2009/08/09/how-to-round-to-the-nearest-whole-multiple-or-fraction-in-sql/#comment-16804</link>
		<dc:creator>n</dc:creator>
		<pubDate>Sat, 22 Aug 2009 01:37:44 +0000</pubDate>
		<guid isPermaLink="false">http://www.xaprb.com/blog/?p=1214#comment-16804</guid>
		<description>hi
no problem either

i ran 

update table 1 
set minnumber=minnumber -5 where min(number)like ‘%%%2.5%%%’
update table 1 
set minnumber=minnumber -5 where min(number)like ‘%%%7.5%%%’

so whereas before any number ending like %%%2.5%%%   was getting  rounded up to 6005 when i wanted it as 6000 and any number ending up like ‘%%%7.5%%%’was getting rounded up to 6010 when i wanted it as 6005 now with the update function everything is corrected.
(isn&#039;t this a nice way to get around the round up problem so simple yet logical)
i know it an extra step but it works and that should count even for a newbielike me (second week learning sql:)) 

beats spending the next few days trying to work out a formula im sure there is one but time dictates if it works move on.</description>
		<content:encoded><![CDATA[<p>hi<br />
no problem either</p>
<p>i ran </p>
<p>update table 1<br />
set minnumber=minnumber -5 where min(number)like ‘%%%2.5%%%’<br />
update table 1<br />
set minnumber=minnumber -5 where min(number)like ‘%%%7.5%%%’</p>
<p>so whereas before any number ending like %%%2.5%%%   was getting  rounded up to 6005 when i wanted it as 6000 and any number ending up like ‘%%%7.5%%%’was getting rounded up to 6010 when i wanted it as 6005 now with the update function everything is corrected.<br />
(isn&#8217;t this a nice way to get around the round up problem so simple yet logical)<br />
i know it an extra step but it works and that should count even for a newbielike me (second week learning sql:)) </p>
<p>beats spending the next few days trying to work out a formula im sure there is one but time dictates if it works move on.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: n</title>
		<link>http://www.xaprb.com/blog/2009/08/09/how-to-round-to-the-nearest-whole-multiple-or-fraction-in-sql/#comment-16798</link>
		<dc:creator>n</dc:creator>
		<pubDate>Fri, 21 Aug 2009 15:24:42 +0000</pubDate>
		<guid isPermaLink="false">http://www.xaprb.com/blog/?p=1214#comment-16798</guid>
		<description>hi found problem if the number equals 6007.5000 or 6002.5000
will always round up ,i used 

minnumber= CAST (cast ((round(min(number) *20000,-5)) as decimal )/20000  AS NUMERIC (8,4))

this sets the number intervals in 5.0 point increments and it always rounds up if number is at &#039;%%%2.5%%%&#039; and &#039;%%%7.5%%%&#039;(ie, midpoint of the 5 point intervals)

how can i set these two numbers so they show as 6000.0000 and 6005.000 respectively whilst not changing the rest
any ideas</description>
		<content:encoded><![CDATA[<p>hi found problem if the number equals 6007.5000 or 6002.5000<br />
will always round up ,i used </p>
<p>minnumber= CAST (cast ((round(min(number) *20000,-5)) as decimal )/20000  AS NUMERIC (8,4))</p>
<p>this sets the number intervals in 5.0 point increments and it always rounds up if number is at &#8216;%%%2.5%%%&#8217; and &#8216;%%%7.5%%%&#8217;(ie, midpoint of the 5 point intervals)</p>
<p>how can i set these two numbers so they show as 6000.0000 and 6005.000 respectively whilst not changing the rest<br />
any ideas</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: n</title>
		<link>http://www.xaprb.com/blog/2009/08/09/how-to-round-to-the-nearest-whole-multiple-or-fraction-in-sql/#comment-16781</link>
		<dc:creator>n</dc:creator>
		<pubDate>Wed, 19 Aug 2009 23:39:06 +0000</pubDate>
		<guid isPermaLink="false">http://www.xaprb.com/blog/?p=1214#comment-16781</guid>
		<description>sixes and sevens no more i just multiplied the number far out  then round((),-5) and divide by same number so now i get the numbers from 6003 to 6007 shown as 6005 and 6008-6112 shown as 6010, 6113 to 6117 as 6015 and so on....

:)</description>
		<content:encoded><![CDATA[<p>sixes and sevens no more i just multiplied the number far out  then round((),-5) and divide by same number so now i get the numbers from 6003 to 6007 shown as 6005 and 6008-6112 shown as 6010, 6113 to 6117 as 6015 and so on&#8230;.</p>
<p>:)</p>
]]></content:encoded>
	</item>
</channel>
</rss>

