Contar capos de una tabla
hola quieira saber como puedo contan lo nombre que tengo en una tabla de tal fecha a tal fecha por ejemplo yo estoy poniendo esto pero no sale correcto
Private Sub XPButton1_Click()
Dim tb As New Recordset
tb.Open "select Count(Nombre) from Bd where FechaInicio Between '" + CStr(Me.dInicio.value) + "' and '" + CStr(Me.dFinal.value) + "'", cn, adOpenStatic
txtCantidad.Text = tb(0)
Private Sub XPButton1_Click()
Dim tb As New Recordset
tb.Open "select Count(Nombre) from Bd where FechaInicio Between '" + CStr(Me.dInicio.value) + "' and '" + CStr(Me.dFinal.value) + "'", cn, adOpenStatic
txtCantidad.Text = tb(0)
hola doggie has intentado con
txtcantidat.txt=tb.count
o si no te funciona podria hacer algo asi
whie not tb.eof
txtcantidad.text=txtcantidad.text + 1
tb.movenext
wend
suerte y espero que te sirva
txtcantidat.txt=tb.count
o si no te funciona podria hacer algo asi
whie not tb.eof
txtcantidad.text=txtcantidad.text + 1
tb.movenext
wend
suerte y espero que te sirva
Asi te puede servir tambien
rstaux1.Open "SELECT COUNT([INVENTARIO].[COD_ART]) AS CONT1 From INVENTARIO where codigo_t='" Cmbarticulo", dbfa, adOpenStatic
If rstaux1(0) <> 0 Then ctlProgreso1.Max = rstaux1(0)
rstaux1.Open "SELECT COUNT([INVENTARIO].[COD_ART]) AS CONT1 From INVENTARIO where codigo_t='" Cmbarticulo", dbfa, adOpenStatic
If rstaux1(0) <> 0 Then ctlProgreso1.Max = rstaux1(0)
'modificando el q tu tienes
tb.Open "select Count(Nombre) AS CONT1 from Bd where campotabla => #" & (Me.dInicio.text) & "# and campotabla => #" & (Me.dIfinal.text) & "#, cn, adOpenStatic
txtCantidad.Text = tb(0)
tb.Open "select Count(Nombre) AS CONT1 from Bd where campotabla => #" & (Me.dInicio.text) & "# and campotabla => #" & (Me.dIfinal.text) & "#, cn, adOpenStatic
txtCantidad.Text = tb(0)
