Quantcast
Channel: Teradata Forums - All forums
Viewing all articles
Browse latest Browse all 27759

data conversion - response (1) by Harpreet Singh

$
0
0
SELECTCASE REP_INT  WHEN  '3' THEN '4'WHEN  '6' THEN '2'WHEN  '7' THEN '52'WHEN '12' THEN '1'WHEN '14' THEN '26'ELSE '12' END  AS Div ,(COALESCE(cnt_mat_dte,pricing_dte) - Per_dte)/365.25000000000000  AS Res_Mat  ,CASE WHEN Res_Mat  <= 0 THEN 1 ELSECAST( (COALESCE(cnt_mat_dte,pricing_dte) - Per_dte)/365.25 * Div AS INT)  END AS Payments FROM t_mor_data 

this code will give you decimals as needed


Viewing all articles
Browse latest Browse all 27759

Trending Articles