ERROR WITH SUM FUNCTION

Database
Enthusiast

ERROR WITH SUM FUNCTION

Below is sample of code that is summing tran_amt based on the value in month_dt. The month_dt is a varchar(2).

How can I sum the the tran_amt?

 

The error msg is :

failed 3535 A character string failed conversion to a numeric value

 

 

select a.prod_acct_no,
       sum(case when b.month_dt in ('01','02','03','04','05','06','07','08
','09','10','11','12') and a.record_rank > 2 then
                tran_amt
           else
                0
       end) as cat_other_tot_lt22
    from PROTO_PSD1.wrk_yes_act_mnth b
    left outer join PROTO_PSD1.wrk_yes_stage_17 a
        on a.prod_acct_no = b.prod_acct_no
        and a.month_dt = b.month_dt
group by a.prod_acct_no


Accepted Solutions
Enthusiast

Re: ERROR WITH SUM FUNCTION

Please ignore above post, I resolved issue.

1 ACCEPTED SOLUTION
1 REPLY
Enthusiast

Re: ERROR WITH SUM FUNCTION

Please ignore above post, I resolved issue.