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!

Problem Creating Calculation

Status
Not open for further replies.

VzSteve

Technical User
Jan 28, 2003
1
US
I am trying to create a calculated field:

sel
tma_pk_hmmou/tot_allow_min as varianc
from table_x

format of tma_pk_hmmou is decimal(7,2)
format of tot_allow_min is integer

I am getting values of 0, 1, 2, 3, etc. I want decimal values. That is, if I divide 223 into 400, teradata is giving me a result of 1; I am expecting a result of .55.

Any thoughts on what I am missing to accomplish this? I would really appreciate it.

Thanks!
Steve
 
To get the decimal we sometimes have to play with multiplying the values by 1 with the number of decimals you want returned. Two places, multiple the results by 1.00, or multiple tot_allow_min by 1.00, one of those should work.

sel
(tma_pk_hmmou/tot_allow_min) * 1.00 as varianc
from table_x

OR

sel
tma_pk_hmmou/(tot_allow_min * 1.00) as varianc
from table_x

Teradata seems to only return results to the least significant value.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top