![Antiguo](http://static.forosdelweb.com/fdwtheme/images/statusicon/post_old.gif)
25/06/2008, 02:49
|
| | Fecha de Ingreso: junio-2008
Mensajes: 15
Antigüedad: 16 años, 7 meses Puntos: 0 | |
Respuesta: Ayuda Access private sub cmdejecutar_click()
Dim servicio As String
Dim fecha1 As Date
Dim fecha2 As Date
servicio = Me.Cuadro_combinado14.Value
fecha1 = Me.Fecha_Inicio.Value
fecha2 = Me.Fecha_Final.Value
Me.Total_Hora_Normal.Value = Nz(DSum("Horas", "consulta1", "Nombre='" & servicio & "' AND fecha > #" & Format(fecha1, "mm/dd/yyyy") & " # and Fecha < # " & Format(fecha2, "mm/dd/yyyy") & "# "), 0)
end sub
Y esta es la sql (consulta1):
SELECT Sum([Personal-Obra].Horas) AS horas
FROM Obras INNER JOIN [Personal-Obra] ON Obras.IdObra=[Personal-Obra].Obra; |