Prev: Returning status/error codes and messages from stored procedures
Next: Is there a Third Party Fuzzy Lookup Control For SSIS
From: Alfred on 16 Mar 2010 11:00 Via a calculation, how do you truncate to 2 decimal places ? ..678952 should be .67 I have seen where people have suggested Round(.678952 , 2 , 1) But I got an error message when i tried that....
From: Plamen Ratchev on 16 Mar 2010 11:15 What error do you get? I just tied: SELECT ROUND(.678952, 2, 1); Results in: --------- 0.670000 -- Plamen Ratchev http://www.SQLStudio.com
From: Alfred on 16 Mar 2010 11:25 Funny... when i put the expression in a view I get "Function argument count error" - but when i write it out in the select it works - hmmm Thanks ! "Plamen Ratchev" <Plamen(a)SQLStudio.com> wrote in message news:VqednWZ54t05PQLWnZ2dnUVZ_vc4AAAA(a)speakeasy.net... > What error do you get? I just tied: > > SELECT ROUND(.678952, 2, 1); > > > Results in: > > --------- > 0.670000 > > -- > Plamen Ratchev > http://www.SQLStudio.com
From: Plamen Ratchev on 16 Mar 2010 11:42 Seems to work fine in a view: CREATE VIEW Foo (x) AS SELECT ROUND(.678952, 2, 1); GO SELECT x FROM Foo; x --------- 0.670000 -- Plamen Ratchev http://www.SQLStudio.com
From: Alfred on 16 Mar 2010 11:40
Yes, as long as you type it in the sql statement... try using the "view" designer tool in Management studio... "Plamen Ratchev" <Plamen(a)SQLStudio.com> wrote in message news:VqednWF54t1NOwLWnZ2dnUVZ_velnZ2d(a)speakeasy.net... > Seems to work fine in a view: > > CREATE VIEW Foo (x) > AS > SELECT ROUND(.678952, 2, 1); > > GO > > SELECT x FROM Foo; > > x > --------- > 0.670000 > > -- > Plamen Ratchev > http://www.SQLStudio.com |