Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
gamaz
Posting Yak Master
104 Posts |
Posted - 2009-04-15 : 11:51:19
|
| Hi,I have a table which is scripted as follows:CREATE TABLE [dbo].[tblprojectionold1]( [ordnum] [nvarchar](10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, [mach] [nvarchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, [hrstorun] [float] NULL) ON [PRIMARY]The sameple data is as follows:select ordnum, mach, hrstorun from tblprojectionold1R041925 1 1I020349 0 4I020425 0 2R042265 0 1I020405 0 2R042294 0 2I020368 0 2R042293 0 3R042220 0 1R042262 0 2I020298 1 0.81I020301 1 19I020322 1 14I020189 2 13.4I020300 2 27R042228 2 6R042269 3 0.48R042008 3 21I020447 3 4I020415 3 7R042190 3 9R041922 4 13.42R042297 4 4R041739 4 10L003686 5 36.86L003681 5 3R041872 5 3I020432 5 9R042007 5 23R042116 6 2Now corresponding to the following values in the hrstorun field0.8113.40.4813.4236.86I would like to round the above so that the output after rounding will show as follows:0.81 will show 113.4 will show 130.48 will show 013.42 will show 1336.86 will show 37How does one achive this here.I appreciate any help for resolution of this problem. Thanks. |
|
|
yosiasz
Master Smack Fu Yak Hacker
1635 Posts |
Posted - 2009-04-15 : 11:53:49
|
| search for and read ROUND function<><><><><><><><><><><><><><><><><><><><><><><><><>If you don't have the passion to help people, you have no passion |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2009-04-15 : 13:58:11
|
| select ordnum, mach, cieling(hrstorun) from tblprojectionold1 |
 |
|
|
|
|
|