Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Truncating A decimal number 1

Status
Not open for further replies.

berryk

MIS
Feb 14, 2002
10
US
If I have a number such as 67.0450123
and I want to pull out just the last three digits
i.e. 123, what SQL command would I use to get at this?

Would I have to turn it into a character first?

Kb
 
Hi,
It takes a little type conversion, but this is the idea:
Code:
  1* select substr(to_char(12345.67892),-3)  from dual
SQL> /

SUB
---
892

SQL>

hth,
[profile]



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top