<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.office.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Writing a Count(Distinct) Query in Access</title><link>http://blogs.office.com/b/microsoft-access/archive/2007/09/19/writing-a-count-distinct-query-in-access.aspx</link><description>We received a question from a reader named Eric week before last about how to write a Count(Distinct) query in Access. In other database applications such as SQL Server, Oracle, and MySQL, the Count(Distinct) aggregate is used to count the number of unique</description><dc:language>en-US</dc:language><generator>Telligent Community 1.5.134.15456 (Build: 5.5.134.15456)</generator><item><title>re: Writing a Count(Distinct) Query in Access</title><link>http://blogs.office.com/b/microsoft-access/archive/2007/09/19/writing-a-count-distinct-query-in-access.aspx#17501</link><pubDate>Mon, 24 Sep 2007 17:41:49 GMT</pubDate><guid isPermaLink="false">53587256-c606-4c9b-bad4-97c86b12ce62:17501</guid><dc:creator>robcooper</dc:creator><description>&lt;p&gt;Frederick - the saved query might make this easier to debug and test. Interestingly enough, the subqueries used here appear in the design surface as a derived table, but the designer doesn&amp;#39;t make the distinction between a saved query or derived table in this case. Grovelli - the SQL syntax used in Access 2007 is the same as in Access 2003. Rob&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.office.com/aggbug.aspx?PostID=17501" width="1" height="1"&gt;</description></item><item><title>re: Writing a Count(Distinct) Query in Access</title><link>http://blogs.office.com/b/microsoft-access/archive/2007/09/19/writing-a-count-distinct-query-in-access.aspx#17502</link><pubDate>Thu, 20 Sep 2007 13:50:38 GMT</pubDate><guid isPermaLink="false">53587256-c606-4c9b-bad4-97c86b12ce62:17502</guid><dc:creator>grovelli</dc:creator><description>&lt;p&gt;Have there been improvements, updates, changes to the SQL Access uses, going from Access 2003 to Access 2007?&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.office.com/aggbug.aspx?PostID=17502" width="1" height="1"&gt;</description></item><item><title>re: Writing a Count(Distinct) Query in Access</title><link>http://blogs.office.com/b/microsoft-access/archive/2007/09/19/writing-a-count-distinct-query-in-access.aspx#17503</link><pubDate>Thu, 20 Sep 2007 04:43:08 GMT</pubDate><guid isPermaLink="false">53587256-c606-4c9b-bad4-97c86b12ce62:17503</guid><dc:creator>Frederick Grose</dc:creator><description>&lt;p&gt;I find it easier to use a saved query, qryColorSums, within another query for this: qryColorSums = SELECT tblColors.Color, Sum(tblColors.Valu) AS Total&lt;/p&gt;
&lt;p&gt;FROM tblColors&lt;/p&gt;
&lt;p&gt;GROUP BY tblColors.Color; qryColorSumsCount = SELECT qryColorSums.Color, First(qryColorSums.[Total]) AS Total, Count(qryColorSums.Color) AS N&lt;/p&gt;
&lt;p&gt;FROM qryColorSums&lt;/p&gt;
&lt;p&gt;GROUP BY qryColorSums.Color; qryCount = SELECT Count(qryColorSums.Color) AS [Count]&lt;/p&gt;
&lt;p&gt;FROM qryColorSums; All this is made easier to understand and remember by viewing in the graphic query designer (paste the SQL text into a query&amp;#39;s SQL View box and then selecting the Design View).&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.office.com/aggbug.aspx?PostID=17503" width="1" height="1"&gt;</description></item></channel></rss>