How to group on records but . . .(one last try) 
Author Message
 How to group on records but . . .(one last try)

I want a query to group records on 3 or 4 fields but in one field (PO) only if
they are consecutive records.  For example, let's say I have:

PO----------------Date-------Category---------Group---------FOBExt

10000------------4/15--------Sleepwear-------Regular-------1000
10001------------4/15--------Sleepwear-------Regular-------1500
10003A----------4/15--------Sleepwear-------Regular-------1400
10004------------10/15-------Daywr--- --------Fash-----------1600
10005------------10/15-------Daywr---- -------Fash-----------2000
10006------------4/15--------Sleepwear-------Regular-------1800

I would want the following reduction grouping on the PO, Date, Category, Group
and Summing FOBExt:

FirstPO----------LastPO----------Date-------Category---------Group--------
-SumFOBExt

10000------------10003A----------4/15--------Sleepwear-------Regular-------3900
10004------------10005----------10/15--------Daywr-------------Fash-------
---3600
10006------------10006------------4/15--------Sleepwear-------Regular------1800

Notice it groups 10000 and 10001 and 10003A on one line eventhough they are not
consecutive numbers (but they are consecutive fields).  (Also the field PO is 5
numbers with an optional Letter.)
Notice also that PO 10006 is not included in this group because, though it has
the same criteria on the Group By, it is not consecutive.  I do group by
queries all the time but they would compact this down to two lines with a false
10000 to 10006 record.   So the question is how do I separate the odd fish?
How to groupby with only consecutive records?

Thanks in advance,

Doyle60



Tue, 08 May 2001 03:00:00 GMT  
 How to group on records but . . .(one last try)
Well, this is a very "manual" solution, but if you don't come up with
anything else, you could step through your table as a DAO recordset, and
write your results to a second table.  For each record, check if the
pertinent fields have changed.  If not, update your current record; if so,
add a new record.

HTH
        - Turtle



Quote:
> I want a query to group records on 3 or 4 fields but in one field (PO)
only if
> they are consecutive records.  For example, let's say I have:

> PO----------------Date-------Category---------Group---------FOBExt

> 10000------------4/15--------Sleepwear-------Regular-------1000
> 10001------------4/15--------Sleepwear-------Regular-------1500
> 10003A----------4/15--------Sleepwear-------Regular-------1400
> 10004------------10/15-------Daywr--- --------Fash-----------1600
> 10005------------10/15-------Daywr---- -------Fash-----------2000
> 10006------------4/15--------Sleepwear-------Regular-------1800

> I would want the following reduction grouping on the PO, Date, Category,
Group
> and Summing FOBExt:

FirstPO----------LastPO----------Date-------Category---------Group--------
Quote:
> -SumFOBExt

10000------------10003A----------4/15--------Sleepwear-------Regular-------3
900
10004------------10005----------10/15--------Daywr-------------Fash-------
Quote:
> ---3600

10006------------10006------------4/15--------Sleepwear-------Regular------1
800

- Show quoted text -

Quote:

> Notice it groups 10000 and 10001 and 10003A on one line eventhough they
are not
> consecutive numbers (but they are consecutive fields).  (Also the field
PO is 5
> numbers with an optional Letter.)
> Notice also that PO 10006 is not included in this group because, though
it has
> the same criteria on the Group By, it is not consecutive.  I do group by
> queries all the time but they would compact this down to two lines with a
false
> 10000 to 10006 record.   So the question is how do I separate the odd
fish?
> How to groupby with only consecutive records?

> Thanks in advance,

> Doyle60



Tue, 08 May 2001 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. One last try....

2. One last try to get the correct attached file

3. One last explanation - apology to the group

4. URGENT: Getting Values from First/Last Record of a Group

5. Current record : first or last one ?

6. ADO 2.5 and memory leaking when adding records (ignore last one)

7. trying to copy one database record to another

8. Selecting one record in group

9. Help: retrieve LAST record on database of 50.000 record

10. Suppressing Groups but the records are still grouped

11. Grouping records within the group

12. Excel to Access, last try.

 

 
Powered by phpBB® Forum Software