Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Return First Two Numbers in Decimal Result

Status
Not open for further replies.

larrydavid

Programmer
Jul 22, 2010
174
US
Hello,

I have this numerator/denominator in my SQL statement:
Code:
[Denial Ratio] = (SELECT COUNT(oc.[CLAIMNO]) FROM CLAIMS oc WHERE oc.chkamt1 = 0.00 AND oc.chkamt2 = 0.00 AND oc.chkamt3 = 0.00) * 1.0 / COUNT(oc.CLAIMNO) * 100,
The output is:
Code:
[Denial Ratio]
621147.950428979900
479811.634756995500
503932.095901005400
892581.095890410900
513058.425196850300
1054343.365695792800
1544038.388625592400
I've tried several functions (ROUND, LEFT, MATH(floor) to name a few) to round this to the first two numbers so my desired output would be:
Code:
[Denial Ratio]
62.11479504289799
47.98116347569955
50.39320959010054
89.25810958904109
51.30584251968503
10.543433656957928
15.440383886255924
I'm pulling out my last hair. If anyone can provide an example or point in the right direction I would be much obliged.

Thanks,
Larry
 
have you ried this --

[Denial Ratio] = (SELECT COUNT(oc.[CLAIMNO]) FROM CLAIMS oc WHERE oc.chkamt1 = 0.00 AND oc.chkamt2 = 0.00 AND oc.chkamt3 = 0.00) * 1.0 / [red](SELECT COUNT(CLAIMNO) FROM CLAIMS)[/red] * 100,

r937.com | rudy.ca
Buy my new book Simply SQL from Amazon
 
I'll try it. But what is the difference between doing a "select" count vs. a count?
 
But what is the difference between doing a "select" count vs. a count?
i can answer that as soon as you try it and report the results


and if it doesn't work, i would want to see the entire query


:)

r937.com | rudy.ca
Buy my new book Simply SQL from Amazon
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top