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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Retreiving part of decimal in SQL Select

Status
Not open for further replies.

IanKidd

Programmer
Jun 21, 2002
5
0
0
GB
I have a field that is a decimal - how do I use a SELECT SQL statement to retrieve only the amount before/after the decimal point?

i.e. value is 4.55 I want to select "4" and "55".

Thanks.
 
Ian:

You can use one of the Informix built-in functions:

Given:

table o_table with a decimal column issqty:

select TRUNC(issqty), ((issqty - TRUNC(issqty)) * 100) from o_table

is close to what you want. There is a built-in MOD function, but I'm unable to get it to work.

This should get you started.

Regards,

Ed
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top