I wondered if anyone can help - I have been working on this trigger for 3 days now - with no luck.
I have two fields TIME_RESOLVED and TIME_STARTED - all I want to do is take one from the other and put the value in TIME_TAKEN field.
The trigger 'works' after a fashion - but will only insert 00.00 no matter what values I use. Can anyone PLEASE tell me where I am going wrong.
Thank you.
Code below (if this helps)
begin
if :new.TIME_TAKEN is null and
:new.DATE_RESOLVED is not null and
:new.TIME_RESOLVED is not null then
select to_date((sysdate) + mod((to_datenew.TIME_RESOLVED,'dd-mm-yyyy hh24.mi')
- to_datenew.TIME_STARTED,'dd-mm-yyyy hh24.mi')),1), 'dd-mm-yyyy hh24.mi')
into :new.TIME_TAKEN from dual;
end if;
end;
I have two fields TIME_RESOLVED and TIME_STARTED - all I want to do is take one from the other and put the value in TIME_TAKEN field.
The trigger 'works' after a fashion - but will only insert 00.00 no matter what values I use. Can anyone PLEASE tell me where I am going wrong.
Thank you.
Code below (if this helps)
begin
if :new.TIME_TAKEN is null and
:new.DATE_RESOLVED is not null and
:new.TIME_RESOLVED is not null then
select to_date((sysdate) + mod((to_datenew.TIME_RESOLVED,'dd-mm-yyyy hh24.mi')
- to_datenew.TIME_STARTED,'dd-mm-yyyy hh24.mi')),1), 'dd-mm-yyyy hh24.mi')
into :new.TIME_TAKEN from dual;
end if;
end;