Hi guys,
I'm going to make a report which will contain a lot of results. Instead of running a query for each result, I want to have one big query that covers all results (this is more effective... or?)
How can I put these two queries into one?
Thanks!
I'm going to make a report which will contain a lot of results. Instead of running a query for each result, I want to have one big query that covers all results (this is more effective... or?)
How can I put these two queries into one?
Code:
qry = "SELECT Count(*) AS CountResult01 " & _
" FROM TblScore WHERE " & _
" [Score1] = 30 "
rs.Open qry, CurrentProject.Connection, adOpenStatic, adLockOptimistic
Me.Result01.Caption = rs!CountResult01
rs.Close
qry = "SELECT Count(*) AS CountResult02 " & _
" FROM TblScore WHERE " & _
" [Score1] = 40 "
rs.Open qry, CurrentProject.Connection, adOpenStatic, adLockOptimistic
Me.Result02.Caption = rs!CountResult02
rs.Close
Thanks!