Click here to Skip to main content
15,906,335 members
Home / Discussions / Database
   

Database

 
AnswerRe: Deleting from an SQL database Pin
DotNetDominator7-May-06 2:02
DotNetDominator7-May-06 2:02 
GeneralRe: Deleting from an SQL database Pin
alee15.10.887-May-06 20:12
alee15.10.887-May-06 20:12 
AnswerRe: Deleting from an SQL database Pin
Rob Graham7-May-06 4:06
Rob Graham7-May-06 4:06 
QuestionSQL2005 Express reporting services remote user Pin
juszuf5-May-06 20:37
juszuf5-May-06 20:37 
QuestionUsing ROUND Pin
myNameIsRon5-May-06 19:03
myNameIsRon5-May-06 19:03 
AnswerRe: Using ROUND Pin
Rob Graham7-May-06 5:52
Rob Graham7-May-06 5:52 
GeneralRe: Using ROUND Pin
myNameIsRon7-May-06 11:16
myNameIsRon7-May-06 11:16 
GeneralRe: Using ROUND Pin
Rob Graham7-May-06 12:30
Rob Graham7-May-06 12:30 
myNameIsRon wrote:
It looks like I shouldn't use ROUND, in my SQL because I'm wanting cash register type of rounding (always round up). It's too bad they don't have parameter options to select the type of rounding you want.


Actually, SQL servers Round( a,b,c) funtion is parameterized to select between "round up" (c==0) and truncate (C!=0)
select Round(1.5,0,0)  -> 2.0 round up .5+
select round(2.5,0,0)  -> 3.0 round up 2.5 and greater
select round(2.4,0,0)  -> 2.0 round down 2.0 to 2.5 exclusive
select Round(1.5,0,1)  -> 1.0
select round(2.5,0,1)  -> 2.0


I think the problem with your example was just the wrong choice for the b ( # decimals)
parameter - you used 3, when what you wanted was 2 (assuming you wanted to round .005
and larger to .01 and .004 and smaller to 0.00. If what you realy wanted was to round
.11+ TO .12 , then use Ceiling(x *100)/100 - round any fraction to next highest integer


a good discussion of the varous rounding schemes can be found here.[^]

I think your observation on SUM() is correct, I know of no other solution.

We need to graduate from the ridiculous notion that greed is some kind of elixir for capitalism - it's the downfall of capitalism. Self-interest, maybe, but self-interest run amok does not serve anyone. The core value of conscious capitalism is enlightened self-interest.
Patricia Aburdene




-- modified at 18:31 Sunday 7th May, 2006
GeneralRe: Using ROUND Pin
myNameIsRon7-May-06 19:19
myNameIsRon7-May-06 19:19 
GeneralRe: Using ROUND Pin
Rob Graham8-May-06 8:49
Rob Graham8-May-06 8:49 
GeneralRe: Using ROUND Pin
myNameIsRon8-May-06 12:28
myNameIsRon8-May-06 12:28 
GeneralRe: Using ROUND Pin
Rob Graham8-May-06 16:48
Rob Graham8-May-06 16:48 
GeneralRe: Using ROUND Pin
myNameIsRon8-May-06 21:34
myNameIsRon8-May-06 21:34 
QuestionReporting Service 2005 Pin
devvvy5-May-06 14:38
devvvy5-May-06 14:38 
QuestionExport a table to a CSV file Pin
Alvin Ortiz5-May-06 12:46
Alvin Ortiz5-May-06 12:46 
AnswerRe: Export a table to a CSV file Pin
Rob Graham7-May-06 6:07
Rob Graham7-May-06 6:07 
GeneralRe: Export a table to a CSV file Pin
Alvin Ortiz15-May-06 12:27
Alvin Ortiz15-May-06 12:27 
QuestionOutputting RTF from SQL Reporting? Pin
dxben5-May-06 5:54
dxben5-May-06 5:54 
QuestionInstr function for SQL Pin
MatthysDT5-May-06 1:54
MatthysDT5-May-06 1:54 
AnswerRe: Instr function for SQL Pin
sathish s5-May-06 2:07
sathish s5-May-06 2:07 
QuestionSQL or TSQL Help Needed Pin
Naveed Kamboh5-May-06 0:42
Naveed Kamboh5-May-06 0:42 
AnswerRe: SQL or TSQL Help Needed Pin
sathish s5-May-06 1:36
sathish s5-May-06 1:36 
GeneralRe: SQL or TSQL Help Needed Pin
Naveed Kamboh5-May-06 2:03
Naveed Kamboh5-May-06 2:03 
QuestionReg Stored Proc Parameter usage & performance Pin
Pradeep Shamarao4-May-06 23:15
Pradeep Shamarao4-May-06 23:15 
QuestionMSDE and MS SQL 2005 Express Edition inquiry Pin
Kuira4-May-06 13:35
Kuira4-May-06 13:35 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.