<div dir="ltr">Thanks Ken - I&#39;ll give that a shot</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Jul 7, 2014 at 10:40 AM, Kenneth Brody <span dir="ltr">&lt;<a href="mailto:kenbrody@spamcop.net" target="_blank">kenbrody@spamcop.net</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>On 7/2/2014 11:18 AM, <a href="mailto:scooter6@gmail.com" target="_blank">scooter6@gmail.com</a> wrote:<br>
<blockquote style="margin:0px 0px 0px 0.8ex;padding-left:1ex;border-left-color:rgb(204,204,204);border-left-width:1px;border-left-style:solid" class="gmail_quote">
A little stumped here<br>
I have a temp file we put records in during day....and I&#39;d like to print a<br>
summary &#39;cover sheet&#39; nightly based on what is in this file<br>
<br>
So I have records that will look like this (all based on client number,<br>
which is first 4 numbers of our &#39;Account Number&#39;)<br>
<br>
2435-0001        John Smith<br>
2435-0002        Jane Doe<br>
3194-0143        John Consumer<br>
3194-0144         Billy Carter<br>
3194-0145         Ronald Reagan<br>
5498-0254         George Bush<br>
5498-0255         Bill Clinton<br>
<br>
So, at night, I want to print 3 &#39;CoverSheets&#39; (one for each unique client<br>
number: 2435, 3194 &amp; 5498)<br>
<br>
The CoverSheet report will basically say:<br>
<br>
Client Number:    2435<br>
Client Name    :   *aa  (this will lookup the client file using 2435 and<br>
grab the client name)<br>
# of Records    :   2     (this should count 2435-0001 &amp; 2435-0002 and<br>
total unique records)<br>
Starting acct     :  0001  (lowest &#39;acct&#39; for 2435)<br>
Ending acct      :  0002   (highest &#39;acct&#39; for 2435)<br>
</blockquote></div>
[...]<br>
<br>
There are several ways I see to do this.  Here is one method:<br>
<br>
Sort on the first 4 digits of the client number (ie: &quot;2345&quot;, &quot;3194&quot;, &quot;5498&quot;), with a subtotal break, followed by the entire 9-digit number.  This way, while you break on the 4-digit client number, it will also be sorted by account number.<br>

<br>
Using @SBRK1, save the first (ie: &quot;lowest&quot;) account number for that client, using MID.<br>
<br>
Within @WBRK1, grab the account number, which will be the &quot;highest&quot; number for that client.  Then, @RS will be the number of records for that account.<br>
<br>
You now have &quot;# of records&quot; (@RS), &quot;starting acct&quot; (saved in @SBRK1), and &quot;ending acct&quot; (the &quot;current&quot; account number, while in @WBRK1).<span class="HOEnZb"><font color="#888888"><br>

<br>
-- <br>
Kenneth Brody<br>
</font></span></blockquote></div><br></div>