Certainly. For starters I used gunther's advice for replacing the r.write.seq.file() function. This was so I could use my new.concat.date variable as a sorted input. Set them appropriately in the before.program section.
domain tcmcs.long old.concat.date
extern domain tcmcs.long new.concat.date
extern domain tcbool report.sort
#define ORIGINAL.FUNCTION() originally.generated.r.write.seq.file()
#define r.write.seq.file() ORIGINAL.FUNCTION()
function extern r.write.seq.file()
new.concat.date = val(sprintf$("%u(%04Y%02m%02d)",tisfc010.prdt))
I used the after.receive.data section to determine when to trigger my subtotal line. Finding the after.receive.data section in the documentation was a big help. old.concat.date is initially set to 0 in the before.program section, so I used that in the if statement to suppress the first empty subtotal that was printing (since the first record's date and 0 are always different, it triggered a subtotal line immediately. a simple "and old.concat.date <> 0" fixed that). In my detail section, I manually accumulate the number that will be displayed in the subtotal line instead of using the aggregate, so I also zero it out here if the subtotal line boolean is true in order to start over.
if new.concat.date <> old.concat.date and old.concat.date <> 0 then
report.sort = 1
report.sort = 0
if report.sort = 1 then
subtotal = 0
subtotal = subtotal + tisfc010.qpli
| some additional query code here...
After the detail layout prints I use the after.layout to set the old.concat.date variable equal to the new (current record) date for use on the next iteration.
old.concat.date = new.concat.date
In my layouts, my after.field triggers on the new.concat.date input field created earlier. The output expression is "report.sort = 1". And presto. It sorts based on date only and not time!