462,889 Members | 714 Online
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 462,889 IT Pros & Developers. It's quick & easy.

# Group and Count records in a table

 P: 77 Hi, I have a table with the type of data as below, sorted as follows, Case (ascending), Loc (ascending) and Transaction Date (ascending). Expand|Select|Wrap|Line Numbers CASE    LOC    TRANSACTION DATE     FACILITY 0029174    01    20061025            STORE-A 0029174    01    20061102            WAREHOUSE-1 0029174    01    20061124            WAREHOUSE-1 0029174    01    20061221            WAREHOUSE-1 0029174    01    20080414            STORE-B 0029174    01    20080506            WAREHOUSE-1 0029174    01    20080507            STORE-C 0029174    01    20080603            WAREHOUSE-1 0029174    01    20080706            WAREHOUSE-1 I am trying to count the records like this, the first record where Facility = Store-A as record number 1, next three records where Facility = Warehouse-1 as record number 2, next record where Facility = Store-B as record number 3, next record where Facility = Warehouse-1 as record number 4,next record where Facility = Store-C as record number 5 and next two records where Facility = Warehouse-1 as record number 6. So the count for case = 0029174 and loc = 01 should be 6 records. Hope I explained it properly Please treat this as urgent and help. Sep 5 '08 #1