Re: How to summarize recordset...Select Distinct alternative?
- From: "Bob Barrows [MVP]" <reb01501@xxxxxxxxxxxxxxx>
- Date: Tue, 13 Nov 2007 16:21:52 -0500
MP wrote:
Thanks Bob,
sorry bout that...
vb6
ado / adox 2.8
(writing to .mdb format)
(not using access, just jet)
<Report:>
File/Page Summary:
File1
Page1
Item1 Count(3)
Item2 Count(2)
Item3 Count(1)
Totals Summary:
Item1 TotalCount(12)
Item2 TotalCount(4)
Item3 TotalCount(3)
Item4 TotalCount(4)
<End Report>
Your options are limited with Jet. Shaped recordsets may be the answer,
but I've never used them and can only advise you to look them up in the
documentation.
This could be done with a single recordset, but I think I would go with
two recordsets:
1. Select FldFile,FldPage,FldItem,Count(*) As ItemCount
FROM ...
GROUP BY FldFile,FldPage,FldItem
You can loop through this one to using Filter to easily do the first
section of your report. You could increment some variables (or array
elements) during the loop to get the values for the Totals, or you could
close this recordset and open a second on the following sql:
2. Select FldItem,Count(*) As ItemCount
FROM ...
GROUP BY FldItem
You can loop through this one for your totals section
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
.
- Follow-Ups:
- References:
- Prev by Date: Re: How to summarize recordset...Select Distinct alternative?
- Next by Date: Re: Best Practices for DataAccess Layer in VB6
- Previous by thread: Re: How to summarize recordset...Select Distinct alternative?
- Next by thread: Re: How to summarize recordset...Select Distinct alternative?
- Index(es):
Relevant Pages
|
|