Re: Need help with RATIO and ROUND
From: Jim Kennedy <kennedy-down_with_spammers_at_attbi.com>
Date: Wed, 25 Jun 2003 02:29:25 GMT
Message-ID: <9O7Ka.13364$nG.16921_at_rwcrnsc51.ops.asp.att.net>
Date: Wed, 25 Jun 2003 02:29:25 GMT
Message-ID: <9O7Ka.13364$nG.16921_at_rwcrnsc51.ops.asp.att.net>
You will have to write a round function that rounds to the nearest 50. Use
truncate and mod and subtraction.
Jim
-- Replace part of the email address: kennedy-down_with_spammers_at_attbi.com with family. Remove the negative part, keep the minus sign. You can figure it out. "Marc A. Lefebvre US-775" <lefebvre_at_iwavesolutions.com> wrote in message news:5ef1a86c.0306241236.5b7e416a_at_posting.google.com...Received on Wed Jun 25 2003 - 04:29:25 CEST
> I have a table that I need to extract values, determine their ratio,
> and then round to the nearest 50.
>
> SELECT NAME, MFG, ROUND((WEIGHT/VOLUME),50) AS WV_RATIO, COUNT(*) OVER
> (ORDER BY NAME, MFG, WV_RATIO) AS NUMBER_OF_MATCHES FROM MEMBERS;
>
>
> 1) To calculate the ratio, can I just use the "/" symbol in my select
> statement?
>
> 2) I want to ROUND this ratio to the nearest 50. Ie. 0, 50, 100,
> 150, 200... How can this be accomplished?
>
> Thanks!!
>
> Marc