Group:  Microsoft Access ยป microsoft.public.access.modulescoding
Thread: Domain aggregate function to count unique values?

DotNetBag
.NET Development Newsgroups

HTVi
TV Discussion Newsgroups

Our Hot Pick: Rising Antivirus 2006 - Certified by TUV & Checkmark! Get 10% discount by entering this coupon code: ONDISCOUNT10
Rising Antivirus 2006

Domain aggregate function to count unique values?
"EmBee" <usenetNOT_THIS[ at ]MargaretBartley.com> 17.08.2006 21:47:11
If I were using the UI, I would create a Totals query to find the number of
unique values in a field, but I want to put that number into a variable in
my code. Is there any way to do that using a Domain Aggregate function, or
do I have to create a recordset based on a Totals query, and open the
recordset and read the first record?

Thank you.


Re: Domain aggregate function to count unique values?
"Allen Browne" <AllenBrowne[ at ]SeeSig.Invalid> 18.08.2006 06:42:07
Okay, this gets asked reasonably often, so here is a new article:
ECount() - an extended DCount()
at:
http://allenbrowne.com/ser-66.html

ECount() takes the same arguments as DCount(), but an extra flag you can set
to retrieve the distinct count.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"EmBee" <usenetNOT_THIS[ at ]MargaretBartley.com> wrote in message
news:eFbK4akwGHA.1624[ at ]TK2MSFTNGP02.phx.gbl...
[Quoted Text]
> If I were using the UI, I would create a Totals query to find the number
> of
> unique values in a field, but I want to put that number into a variable in
> my code. Is there any way to do that using a Domain Aggregate function,
> or
> do I have to create a recordset based on a Totals query, and open the
> recordset and read the first record?


Re: Domain aggregate function to count unique values?
"EmBee" <usenetNOT_THIS[ at ]MargaretBartley.com> 05.09.2006 19:55:11
OK, I was just checking. I've found myself doing things unnecessarily
complicated, but it looks like that's what we have to do here.

Thank you,

"Allen Browne" <AllenBrowne[ at ]SeeSig.Invalid> wrote in message
news:uWrIwFpwGHA.3964[ at ]TK2MSFTNGP04.phx.gbl...
[Quoted Text]
> Okay, this gets asked reasonably often, so here is a new article:
> ECount() - an extended DCount()
> at:
> http://allenbrowne.com/ser-66.html
>
> ECount() takes the same arguments as DCount(), but an extra flag you can
set
> to retrieve the distinct count.
>
> --
> Allen Browne - Microsoft MVP. Perth, Western Australia.
> Tips for Access users - http://allenbrowne.com/tips.html
> Reply to group, rather than allenbrowne at mvps dot org.
>
> "EmBee" <usenetNOT_THIS[ at ]MargaretBartley.com> wrote in message
> news:eFbK4akwGHA.1624[ at ]TK2MSFTNGP02.phx.gbl...
> > If I were using the UI, I would create a Totals query to find the number
> > of
> > unique values in a field, but I want to put that number into a variable
in
> > my code. Is there any way to do that using a Domain Aggregate function,
> > or
> > do I have to create a recordset based on a Totals query, and open the
> > recordset and read the first record?
>
>


Home | Search | Terms | Imprint | Contact
Newsgroups Reader - provided by WiredBox.Net