<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Database Lessons &#187; microsoft access</title>
	<atom:link href="http://databaselessons.com/blog/tag/microsoft-access/feed/" rel="self" type="application/rss+xml" />
	<link>http://databaselessons.com/blog</link>
	<description>Tips for MS Access users</description>
	<lastBuildDate>Tue, 19 Jul 2011 11:48:55 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Simple Report With SubTotals and Grand Totals</title>
		<link>http://databaselessons.com/blog/simple-report-with-subtotals-and-grand-totals/</link>
		<comments>http://databaselessons.com/blog/simple-report-with-subtotals-and-grand-totals/#comments</comments>
		<pubDate>Wed, 10 Mar 2010 18:53:26 +0000</pubDate>
		<dc:creator>manxman</dc:creator>
				<category><![CDATA[Tips and Tricks]]></category>
		<category><![CDATA[access]]></category>
		<category><![CDATA[grand total]]></category>
		<category><![CDATA[microsoft access]]></category>
		<category><![CDATA[ms access]]></category>
		<category><![CDATA[report]]></category>
		<category><![CDATA[subtotals]]></category>

		<guid isPermaLink="false">http://databaselessons.com/blog/?p=109</guid>
		<description><![CDATA[Someone read the post from 2 days ago and took this to a slightly further point. How can I list all the details, and also list subtotals by a subset of the itemID, and then a grand total. They were referring specifically to a report of the data. Here is some fake data I created [...]]]></description>
			<content:encoded><![CDATA[<p>Someone read the post from 2 days ago and took this to a slightly further point.</p>
<p>How can I list all the details, and also list subtotals by a subset of the itemID, and then a grand total. They were referring specifically to a report of the data.</p>
<p>Here is some fake data I created to illustrate.</p>
<pre>
itemid   cost
01142    $1.00
01222    $7.00
01333    $2.00
01623    $4.00
01777    $7.00
01997    $4.00
02456    $8.00
02556    $5.00
02666    $9.00
02716    $8.00
02796    $9.00
02916    $2.00
03455    $5.00
03485    $4.00
03555    $7.00
03675    $7.00
05666    $6.00
05886    $1.00
</pre>
<p>The report should look like this. (plus appropriate headers)</p>
<pre>
itemid   cost
01142    $1.00
01222    $7.00
01333    $2.00
01623    $4.00
01777    $7.00
01997    $4.00
01 subtotal = $25.00
02456    $8.00
02556    $5.00
02666    $9.00
02716    $8.00
02796    $9.00
02916    $2.00
02 subtotal = $41.00
03455    $5.00
03485    $4.00
03555    $7.00
03675    $7.00
03 subtotal = $23.00
05666    $6.00
05886    $1.00
05 subtotal = $7.00

grand total = $96.00
</pre>
<p>Here are the steps needed in Microsoft Access 2000. I am not putting in every small detail, as I believe you should think about what you are doing, and copying every tiny detail from me will not help you.</p>
<ul>
<li>start the report wizard, giving it the name of the table you are needing</li>
<li>select the itemID and cost fields</li>
<li>choose itemID as a grouping field</li>
<li>click the Grouping Options button and choose a Grouping interval of &#8220;2 initial letters&#8221;</li>
<li>no sorting is needed, but under Summary Options you want the Sum of the cost field</li>
<li>pick a style and finish the report&#8217;s creation (Note: give it a proper name, like rptCosts, or similar)</li>
</ul>
<p>The report is not quite what we wanted, but is close.</p>
<p>Next I went into the design view of the wizard created report and &#8230;</p>
<ul>
<li>deleted the &#8220;Summary for &#8230;&#8221; item from the itemID footer</li>
<li>moved the &#8220;Left$ &#8230;&#8221; item from the itemID header to the itemID footer</li>
<li>rearranged the objects in the itemID footer to better emulate the design I wanted</li>
<li>went into the Sorting and Grouping section under the view menu</li>
<li>changed the itemID Group Header to &#8220;No&#8221;</li>
<li>continued to play with formatting until I had it the way I wanted it</li>
</ul>
<p>See printouts, <a href="http://www.databaselessons.com/blog/wp-content/uploads/rptData1.pdf"><strong>before</strong></a> and <a href="http://www.databaselessons.com/blog/wp-content/uploads/rptData1.pdf"><strong>after</strong></a> changes, by clicking on the links in this sentence.</p>
<p>The key in my MS Access self-done education period was to use the wizard like we just did, and look at the design and especially properties of objects, and the Sorting and Grouping dialogue box. I experimented and discovered &#8220;stuff&#8221;.</p>
<p>Hopefully I can help you discover that &#8220;stuff&#8221; faster than I did, but in a way that still helps you &#8220;see&#8221; what is going on. Don&#8217;t ever depend solely on a recipe book. Discover the principles so that you can create your own recipes.</p>
]]></content:encoded>
			<wfw:commentRss>http://databaselessons.com/blog/simple-report-with-subtotals-and-grand-totals/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How To Do Group By Queries On Groups</title>
		<link>http://databaselessons.com/blog/how-to-do-group-by-queries-on-groups/</link>
		<comments>http://databaselessons.com/blog/how-to-do-group-by-queries-on-groups/#comments</comments>
		<pubDate>Mon, 08 Mar 2010 11:12:17 +0000</pubDate>
		<dc:creator>manxman</dc:creator>
				<category><![CDATA[Tips and Tricks]]></category>
		<category><![CDATA[group by]]></category>
		<category><![CDATA[microsoft access]]></category>
		<category><![CDATA[ms access]]></category>
		<category><![CDATA[Queries]]></category>
		<category><![CDATA[query]]></category>

		<guid isPermaLink="false">http://databaselessons.com/blog/?p=97</guid>
		<description><![CDATA[I know. Lousy title. Could not dream anything better up at 5:30 am on a Monday morning! A reader wrote in to ask why they could not get their MS Access summary query working. They wanted a report like this. Group Budget Actual 01 $ 34,000 $ 33,756 02 $ 75,000 $ 69,955 03 $ [...]]]></description>
			<content:encoded><![CDATA[<p>I know. Lousy title. Could not dream anything better up at 5:30 am on a Monday morning!</p>
<p>A reader wrote in to ask why they could not get their MS Access summary query working. They wanted a report like this.</p>
<pre>
Group       Budget      Actual
01          $ 34,000    $ 33,756
02          $ 75,000    $ 69,955
03          $ 12,000    $ 13,750
04          $ 25,000    $ 21,223
</pre>
<p>But their report looked like this.</p>
<pre>
Group       Budget      Actual
010250      $ 20,000    $ 20,000
010500      $ 14,000    $ 13,756
020722      $ 20,000    $ 13,455
020999      $ 55,000    $ 56,500
etc.
</pre>
<p>The thing is, that &#8220;Group&#8221; column is based on a BudgetCode field that has values like this.</p>
<p>010250<br />
010500<br />
020722<br />
020999<br />
etc.</p>
<p>The base query that gets us partway there is easily done using the Query Builder. (the steps that I followed below are based on Microsoft Access 2000, but easily translated to other versions)</p>
<ul>
<li>go to the query tab in Access</li>
<li>click on &#8220;New&#8221;</li>
<li>choose Design View and click OK</li>
<li>select the table (or possibly another query) and click Add</li>
<li>click Close</li>
<li>drag the BudgetCode, BudgetAmount, and ActualAmount fields to the query grid</li>
<li>click on the sum symbol (funny looking &#8220;E&#8221; in the toolbar)</li>
<li>under the BudgetAmount and ActualAmount fields in the query grid, click on the Total cell</li>
<li>from the drop down list choose Sum</li>
<li>run the query (use the red exclamation mark in toolbar)</li>
</ul>
<p>That gives us the report style that our reader initially created. With one minor change we will get the final result that we want, summarizing based on just the first 2 characters of the BudgetCode field.</p>
<ul>
<li>go back to design view (a little blue triangle symbol at the far left of the toolbar, or under the &#8220;View&#8221; menu)</li>
<li>change the BudgetCode field name to this (without quotes) &#8211; &#8220;left([BudgetCode],2)&#8221;</li>
<li>rerun the query</li>
</ul>
<p>As a final note, let&#8217;s see what the actual &#8220;code&#8221; looks like. Under the View menu, choose the &#8220;SQL View&#8221;.</p>
<pre>
SELECT Left([BudgetCode],2) AS Expr1,
Sum(data.BudgetAmount) AS SumOfBudgetAmount,
Sum(data.ActualAmount) AS SumOfActualAmount
FROM data
GROUP BY Left([BudgetCode],2);
</pre>
<p>Cool!</p>
<p>As usual, leave comments about your success or questions. Thanks.</p>
]]></content:encoded>
			<wfw:commentRss>http://databaselessons.com/blog/how-to-do-group-by-queries-on-groups/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

