Ver Mensaje Individual
  #3  
Antiguo 27-01-2005
noobdelphi noobdelphi is offline
Registrado
 
Registrado: ene 2005
Posts: 8
Reputación: 0
noobdelphi Va por buen camino
Aclaro que new.md_hoin esta declarada en la tabla como time
Código SQL [-]
 CREATE TRIGGER MOVDIA_TG_MOV FOR MOVDIA
 INACTIVE AFTER INSERT OR UPDATE POSITION 10
 AS
 declare variable hst time;
 declare variable hn time;
 declare variable het time;
 declare variable hsm time;
 declare variable timeout time;
 declare variable timein time;
 declare variable fein date;
 begin
         if(new.md_feout>new.md_fein )then
         begin
              fein=new.md_fein;
              timein=new.md_hoin;(AKI ME GENERA EL ERROR)
              if(new.md_hoin > :hst)then
              begin
                     hn=0;
              end
              if(:het<=:timein and :timein<=:hst)then
              begin
                     hn=:hst-:timein;
              end
              if(:hsm<:timein and :timein<:het)then
              begin
                     hn=:hst-:het;
              end
 
              if(:timein<=:hsm)then
              begin
                     hn=(:hst-:het)+(:hst-:timein);
              end
 
         end
 end

puse todo el ejemplo porque me ademas quisiera saber si las operaciones con horas se pueden hacer de manera directa como lo intento hacer.
todos los datos los saco de valores de otras tablas por medio de un select.
muchas gracias por la ayuda que me puedan prestar
Responder Con Cita