Ver Mensaje Individual
  #1 (permalink)  
Antiguo 17/03/2004, 06:26
david1981
 
Fecha de Ingreso: enero-2004
Mensajes: 75
Antigüedad: 21 años, 2 meses
Puntos: 0
Problema con visual basic .net

Quiero sumar una columna con campos nulos, como lo puedo hacer? yo tengo hecho lo siguiente, pero no funciona.
GRACIAS


oData1 = Conexion.calculo("SELECT Horas FROM Presencia WHERE Codigo = '" & TextBox1.Text & "' AND Fecha = '" & Calendar.Text & "'")
Dim oConsulta As New DataSet
Dim d As Integer
oConsulta = Conexion.SelecEntrada("Select Horas From Presencia WHERE Codigo = '" & TextBox1.Text & "' and Horas is not null")

For j = 0 To oData1.Tables("Presencia").Rows.Count - 1
For d = 0 To oConsulta.Tables("Presencia").Rows.Count - 1
If oConsulta.Tables("Presencia").Rows(d).Item("Horas" ) Then

Else
iDat1 = oData1.Tables("Presencia").Rows(j).Item("Horas")
iDat2 = iDat1 + iDat2
End If
Next
Next
Trabajtxt.Text = iDat2
End If
__________________
Gracias y un saludo