Kamis, 11 September 2014

Re: [MS_AccessPros] Dcount distinct function

 

Onno-


To do the equivalent of a Count(DISTINCT …), you must first build and save a SELECT DISTINCT query that uses the same criteria you want in your final query.  You may also need to include one or more key values that you use to JOIN with other tables in your final query.  Without knowing the specific problem you're trying to solve, it's tough to give you exact syntax.

Yes, you could also do it with a function call that passes a column name, table name, and criteria similar to a DCount.  That function would execute a SELECT DISTINCT to come up with the answer.

John Viescas, Author
Microsoft Access 2010 Inside Out
Microsoft Access 2007 Inside Out
Microsoft Access 2003 Inside Out
Building Microsoft Access Applications 
SQL Queries for Mere Mortals 
(Paris, France)




On Sep 11, 2014, at 10:41 AM, 'Knol, Onno' onno.knol@pbl.nl [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com> wrote:

Hi pro's

 

I regularly use the count distinct function to get the number unique values of a variable.

Some SQl variants have  a Count distinct function but msaccess does not, as far as I know.

Actually I look for an adapted dcount function that counts the number of unique values in a column.

Has anyone created such a function before, and if so, Could you post it?

Thanks!

 

Onno Knol

 


__._,_.___

Posted by: John Viescas <johnv@msn.com>
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (2)

.

__,_._,___

Tidak ada komentar:

Posting Komentar