<div dir="ltr">Ahh ok gotcha<div>So to subtotal by oldest date first, my sort on output is        date rec'd    descending and x (since I don't want form feed) then 1 (clt#) ?</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Jul 14, 2020 at 12:52 PM Bruce Easton <<a href="mailto:bruce@stn.com">bruce@stn.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">First, an assumption.  I'm assuming that your Ctl as referenced for one <br>
'batch' is the same critter as the first part of your full Acct# based <br>
on what you've shown.<br>
<br>
Just use a couple of global dummy fields to keep track of the lowest and <br>
highest within one ctl.  Below. 'acct_no' can be replaced by your field <br>
number for the account number field.<br>
<br>
   If: lo eq ""'these 6 lines execute for EVERY rec processed<br>
Then: lo="~~~~~"<br>
   If:acct_no lt lo<br>
Then: lo(5,*,g)=acct_no<br>
   If: acct_ho gt hi<br>
Then: hi(5,*,g)=acct_no<br>
   If:<br>
Then: end<br>
.<br>
.<br>
@wbrk1 If:   '<--minor sort (Ctl)<br>
      Then: print; hi=""; lo="~~~~~"; end<br>
<br>
@wbrk2 If:   '<--major sort (Date Recv'd)<br>
      Then: [whatever you're doing now]; print; end<br>
<br>
<br>
On 7/14/20 10:21 AM, <a href="mailto:scooter6@gmail.com" target="_blank">scooter6@gmail.com</a> wrote:<br>
> I guess that's the part I'm struggling with - since I'm using index <br>
> for date, the first record it finds may not be the lowest number in <br>
> that 'batch'<br>
> Would it be better to create an index on date and full account number, <br>
> then grab the first 'acct'?<br>
> thanks<br>
><br>
><br>
> On Mon, Jul 13, 2020 at 3:59 PM Bruce Easton via Filepro-list <br>
> <<a href="mailto:filepro-list@lists.celestial.com" target="_blank">filepro-list@lists.celestial.com</a> <br>
> <mailto:<a href="mailto:filepro-list@lists.celestial.com" target="_blank">filepro-list@lists.celestial.com</a>>> wrote:<br>
><br>
>     Scott - if the only problem is the Starting Acct#, then, are you<br>
>     using a<br>
>     global field to track when the Starting Acct# is less than one<br>
>     previously encountered within a Ctl#?   (And then resetting it<br>
>     back to<br>
>     an arbitrarily high value when you start a new Ctl# after<br>
>     reporting the<br>
>     Ctl#?)<br>
><br>
>     Bruce<br>
><br>
><br>
>     On 7/13/20 2:12 PM, scooter6--- via Filepro-list wrote:<br>
>     > I have a database that has this type structure<br>
>     ><br>
>     > Clt             Acct          Full Acct Date Received<br>
>     > -------         ---------      ----------------------<br>
>     >   -----------------------<br>
>     > 01234        00010      01234-00010          06/01/20<br>
>     > 01234        00011      01234-00011           06/01/20<br>
>     > 01234        00012      01234-00012           06/05/20<br>
>     > 01234        00013      01234-00013           06/10/20<br>
>     > 01235        00250      01235-00250           06/01/20<br>
>     > 01235        00251      01235-00251           06/05/20<br>
>     ><br>
>     > I want to create a report with oldest received date first and a<br>
>     'summary'<br>
>     > line for each batch then in Clt number order<br>
>     ><br>
>     > For example, for the above data set, I want to see<br>
>     ><br>
>     > Date Rec'd      Clt             Starting Acct      Ending Acct <br>
>           Total<br>
>     > in Batch<br>
>     > ---------------      -----------    -----------------<br>
>     > ----------------         ------------------<br>
>     > 06/01/20           01234        00010               00011<br>
>     >           2<br>
>     > 06/01/20           01235        00250               00250<br>
>     >           1<br>
>     >                            Total Received 06/01/20<br>
>     >                3<br>
>     ><br>
>     > 06/05/20           01234        00012               00012<br>
>     >           1<br>
>     > 06/05/20           01235        00251               00251<br>
>     >           1<br>
>     >                             Total Received 06/05/20<br>
>     >               2<br>
>     ><br>
>     > 06/10/20           01234        00013               00013<br>
>     >           1<br>
>     >                              Total Received 06/10/20<br>
>     >                1<br>
>     ><br>
>     ><br>
>     > When I do @wbrk1 - I can get the Ending Account and the Total<br>
>     but even if I<br>
>     > declare the Starting Acct before @wbrk1 - both variables still<br>
>     come out the<br>
>     > same - so I'm apparently missing something there<br>
>     ><br>
>     > I'm using sort order of Date Rec'd and descending and subtotal<br>
>     and subtotal<br>
>     > on Clt<br>
>     > Running this rreport with -ih  (index H which is Date Rec'd)<br>
>     ><br>
>     > I can post full processing table if that helps - but each report<br>
>     dataline<br>
>     > is a field in the actual file<br>
>     > There is a little more I'm doing with it other than this, but<br>
>     it's really<br>
>     > just displaying a few of the other fields - so didn't want to<br>
>     confuse by<br>
>     > posting the full prc table<br>
>     ><br>
>     > thanks<br>
>     > Scott<br>
>     > PDM<br>
>     > -------------- next part --------------<br>
>     > An HTML attachment was scrubbed...<br>
>     > URL:<br>
>     <<a href="http://mailman.celestial.com/pipermail/filepro-list/attachments/20200713/7231d1b1/attachment.html" rel="noreferrer" target="_blank">http://mailman.celestial.com/pipermail/filepro-list/attachments/20200713/7231d1b1/attachment.html</a>><br>
>     > _______________________________________________<br>
>     > Filepro-list mailing list<br>
>     > <a href="mailto:Filepro-list@lists.celestial.com" target="_blank">Filepro-list@lists.celestial.com</a><br>
>     <mailto:<a href="mailto:Filepro-list@lists.celestial.com" target="_blank">Filepro-list@lists.celestial.com</a>><br>
>     > Subscribe/Unsubscribe/Subscription Changes<br>
>     > <a href="http://mailman.celestial.com/mailman/listinfo/filepro-list" rel="noreferrer" target="_blank">http://mailman.celestial.com/mailman/listinfo/filepro-list</a><br>
><br>
><br>
>     _______________________________________________<br>
>     Filepro-list mailing list<br>
>     <a href="mailto:Filepro-list@lists.celestial.com" target="_blank">Filepro-list@lists.celestial.com</a><br>
>     <mailto:<a href="mailto:Filepro-list@lists.celestial.com" target="_blank">Filepro-list@lists.celestial.com</a>><br>
>     Subscribe/Unsubscribe/Subscription Changes<br>
>     <a href="http://mailman.celestial.com/mailman/listinfo/filepro-list" rel="noreferrer" target="_blank">http://mailman.celestial.com/mailman/listinfo/filepro-list</a><br>
><br>
<br>
<br>
</blockquote></div>