Count help

Count help

am 28.11.2007 22:38:59 von Mrbanner

hi all,
I am trying to setup a query
that will count the folling for me

I have the following data example
That i have put over from a field i have filled
what i need is if the number dont show a 1 in any of the rows to show
not to show me data in queue
then i need it to count how many lines there are.
Can this be done?


Adam 27/11 1 1
0 1
John 27/11 0 0
0 0
Billy 28/11 1 0
0 0


Count in this case would be 2

Re: Count help

am 29.11.2007 14:15:03 von Salad

Mrbanner wrote:
> hi all,
> I am trying to setup a query
> that will count the folling for me
>
> I have the following data example
> That i have put over from a field i have filled
> what i need is if the number dont show a 1 in any of the rows to show
> not to show me data in queue
> then i need it to count how many lines there are.
> Can this be done?
>
>
> Adam 27/11 1 1
> 0 1
> John 27/11 0 0
> 0 0
> Billy 28/11 1 0
> 0 0
>
>
> Count in this case would be 2
>

If I understand you correctly...

Dim strSQL As String
Dim rst As Recordset
strSQL = "Select * From Table1 " & _
"Where Field1 <> 0 Or Field2 <> 0 Or Field3 <> 0"
set rst = Currentdb.OpenRecordset(strSQL,Dbopensnapshot)
If rst.RecordCount > 0 then rst.MoveLast
msgbox "RecordCount is " & rst.RecordCount
rst.close
set rst = Nothing