Data Modeling Welcome to the Teradata Forums. Read the guidelines on posting. Email notifications and RSS feeds are available, and also a chronological list of all forum activity.
 mensssanvi 4 posts Joined 04/13 02 May 2013 data conversion This field Resid_Mat is rounding to to 2 decimal places, thus having an effect on the Num_payment field calculation as per attached sql. Does anyone know how I can remedy this? Any help will be much appreciated. An example of Resid_Mat by running the sql gives me 2.32 instead of 2.31895961670089.   -------------- ```SELECT CASE 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.25  AS Res_Mat ,CASE WHEN Res_Mat  <= 0 THEN 1 ELSE CAST( (COALESCE(cnt_mat_dte,pricing_dte) - Per_dte)/365.25 * Div AS INT)  END AS Payments FROM t_mor_data ```   Harpreet Singh 101 posts Joined 10/11 29 May 2013 ```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 You must sign in to leave a comment. Active Posters