Pregunta: | 34414 - FORMULA CON CAMPOS DE TIEMPO |
Autor: | juan plascencia |
hola a todos.
quisiera saber cual es la formula para poder hacer calculos con campos de horarios, especificamente (restas). si alguien a realizado algun programa con este tipo de formula favor de orientarme cual es la formula por favor...... |
Respuesta: | Luis Falconi |
esta funcion la utilizo para calcular los segundos
por ejemplo: hor_ini = v_min("08:30:00") &&& Hora Inicial hor_fin = v_min("18:30:00") &&& Hora Final * Horas trabajadas hor_tra = hor_fin-hor_ini ? v_sayti(hor_tra,1,.F.) muestra formato "10:00:00" ******************** FUNCTION V_MIN PARAMETERS TIEMPO Ti_in1 = Val(Substr(Tiempo,1,3))*60 Ti_in2 = Val(Substr(Tiempo,5,2)) Ti_in1 = Ti_in1 + Ti_in2 STORE Ti_in1 TO Tiempo RETURN tiempo **************** FUNCTION V_SAYTI PARAMETERS WTIE HORAS = WTIE WHORA = INT(HORAS/60) WMINU = HORAS - (WHORA*60) TIEMPO = iiF(ABS(WHORA)= WHORA,PADL(ALLTRIM(STR(WHORA)),3,'0')+':','')+PADL(ALLTRIM(STR(WMINU)),2,'0') TIEMPO = IIF(TIEMPO = '0','',TIEMPO) RETURN tiempo |