If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Microsoft SQL Server > Convert Help Please!

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-27-12, 14:58
biznez biznez is offline
Registered User
 
Join Date: Nov 2011
Posts: 24
Convert Help Please!

i have interest rates in format
0.0527500
0.0525000

i need something like this for eg:

Add leading zeroes(eg. 0.0527500 to be presented as 05275 and 0.0525000 to be presented as 05250)

thanks in advance for help
Reply With Quote
  #2 (permalink)  
Old 01-27-12, 15:05
Pat Phelan Pat Phelan is offline
Resident Curmudgeon
 
Join Date: Feb 2004
Location: In front of the computer
Posts: 12,609
Formatting and presentation issues SHOULD be handled on the client, not within the database. You can do this, but you should not:
Code:
SELECT SubString(CAST(n AS VARCHAR), 3, 5)
   FROM (SELECT 0.0527500 AS n
      UNION ALL SELECT 0.0525000
      ) AS z
-PatP
__________________
In theory, theory and practice are identical. In practice, theory and practice are unrelated.
Reply With Quote
  #3 (permalink)  
Old 01-27-12, 15:33
biznez biznez is offline
Registered User
 
Join Date: Nov 2011
Posts: 24
thanks Pat
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On