2 Replies Latest reply: Feb 25, 2014 11:29 AM by user12182102 RSS

Update Statement

MikeB Newbie
Currently Being Moderated

Could someone please help me modify this SQL statement so it will work in an Oracle environment?

 

update tbraccd
join ttbtaxn on tbraccd.pidm = ttbtaxn.pidm
set tbraccd_effective_date = '01-JAN-2014', tbraccd_entry_date = '01-JAN-2014'
where tbraccd_detail_code = 'VPMT'
and tbraccd_effective_date = '31-DEC-2013'
and (tbraccd_entry_date > '31-DEC-2013' and tbraccd_entry_date < '01-JAN-2014')
and tbraccd_term_code = '201410'
and ttbtaxn_stud_notif_status = 'E'
and ttbtaxn_tax_year = '2013'

  • 1. Re: Update Statement
    Martin Preiss Expert
    Currently Being Moderated
  • 2. Re: Update Statement
    user12182102 Newbie
    Currently Being Moderated

    maybe this?

     

    update tbraccd

       set tbraccd_effective_date = '01-JAN-2014',

           tbraccd_entry_date     = '01-JAN-2014'

    where tbraccd_detail_code    = 'VPMT'

       and tbraccd_effective_date = '31-DEC-2013'

       and tbraccd_entry_date between to_date('31-DEC-2013','dd-mon-yyyy') and

                                      to_date('01-JAN-2014','dd-mon-yyyy')

       and tbraccd_term_code      = '201410'

    where tbraccd.pidm in (select ttbtaxn.pidm

                              from ttbtaxn

                             where ttbtaxn_stud_notif_status = 'E'

                               and ttbtaxn_tax_year = '2013')

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points