Ver Mensaje Individual
  #15 (permalink)  
Antiguo 09/02/2012, 12:14
carreteboy
 
Fecha de Ingreso: febrero-2012
Mensajes: 40
Antigüedad: 12 años, 2 meses
Puntos: 0
Respuesta: Sumar Fechas e insertar cantidad de días

ahaha no hay problema muchas gracias. Entonces también almorzaré acá son las 15:11 (Chile) te espero más tarde.

te dejo el error que surgió.
Código MySQL:
Ver original
  1. #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' FOR EACH ROW SET new.num_diast=(SELECT DATEDIFF(new.fecha_termino,new.fecha_in' at line 2

error resuelto: agregar ´´ a fecha_inicio y fecha_termino

SELECT DATEDIFF('new.fecha_termino','new.fecha_inicio') FROM solicitud_trabajador

Código MySQL:
Ver original
  1. CREATE TRIGGER DIAS_T BEFORE INSERT ON solicitud_trabajador
  2. *FOR EACH ROW SET new.num_diast=(SELECT DATEDIFF(new.fecha_termino,new.fecha_inicio) *
  3. FROM solicitud_trabajador)

MUCHAS GRACIAS RESULTÓ PERFECTO SALUDOS DESDE CHILE

Última edición por carreteboy; 09/02/2012 a las 12:23