'How turn this into a loop where Var1 is a loop of January, February, March so that I get the total for all 3 months
select count(*) from table where Month = Var1
rec2.CursorLocation = adUseClient
rec2.Open (esql), conn, adOpenStatic, adLockOptimistic
Total = Total + rec.Fields(0)
What type of column is "month" (numeric or text)?
Normally, I would create a Select statement that summed/counted the data for a date range, rather than executing three different Select statements.
Example:
Open in new window