Page 1 of 1

Header, detail, and trailer records

Posted: Thu Aug 17, 2006 11:37 am
by btmorris3
I'm trying to create a file with header records, detail records, and trailer records. I'm pulling all the data from one table, then I need to sort by a given field, then for each record with matching values in that field, I need to write a header record, all the datail records, then a trailer record with a count of the detail records. Is there an easy way to do this?

<HEADER_STRa><HEADER_DATE>
<DETAILa1>
<DETAILa2>
<DETAILa3>
<TRAILERa><RECORD_COUNT>
<HEADER_STRb><HEADER_DATE>
<DETAILb1>
<DETAILb2>
<DETAILb3>
<TRAILERb><RECORD_COUNT>

Thanks

Posted: Thu Aug 17, 2006 11:42 am
by chulett
Easy? Not really, but it doesn't have to be all that complicated. You should check this post for ideas. Searches will turn up other conversations on the topic as you're not the first to have to tackle this.