Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Inserting Decimals Expand / Collapse
Author
Message
Posted Monday, July 6, 2009 9:50 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Wednesday, May 12, 2010 1:12 PM
Points: 15, Visits: 13
I have a column of data, but need to extract it with the with a decimal in the string of numbers.

For example I have 425699, when I extract it I would like to see 4256.99

Is that possible with SQL?

Thanks
Post #747848
Posted Monday, July 6, 2009 9:52 AM


SSC-Insane

SSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-Insane

Group: General Forum Members
Last Login: Yesterday @ 7:45 PM
Points: 23,081, Visits: 31,620
This?

declare @TestInt int;
set @TestInt = 425699;
select cast(@TestInt/100.00 as decimal(10,2);




Lynn Pettis

For better assistance in answering your questions, click here
For tips to get better help with Performance Problems, click here
For Running Totals and its variations, click here or when working with partitioned tables
For more about Tally Tables, click here
For more about Cross Tabs and Pivots, click here and here
Managing Transaction Logs

SQL Musings from the Desert Fountain Valley SQL (My Mirror Blog)
Post #747850
Posted Monday, July 6, 2009 10:00 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Wednesday, May 12, 2010 1:12 PM
Points: 15, Visits: 13
Thank you. it worked out perfectly.
Post #747860
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse