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!

AS400 SQL

Status
Not open for further replies.

RiverGuy

Programmer
Jul 18, 2002
5,011
US
Hi. I'm running a query with a calculated field that derives its calculation from fields with decimal points. I would like my output to not round off my output to an integer. Is there an option in SQL that anyone knows of?

Thanks.
 
There are a couple of options, but the most common is;
float( decimal( Value1, 13, 2 ) / decimal( Value2, 9, 3 ) )
or a variation of the statement.
decimal changes the value of "Value1" to a 13,2 field
Float floats the decimal point
You could also enter;
decimal(float(~~~~~~~), 13,2) = results in a 13,2 field
 
Thanks. I was trying pretty much the same thing but without making the whole thing into a float. I'll give yours a try.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top