It is sales tracking. I am doing,
select * from SOP_fromBothHistoryAndWorkingTable where customerID = "ABC" from date ? and ?
Plus all its related records. Meaning,
if result.PreviousSOPNum != null then get that_record, and if that_record.PreviousSOPNum != null then get thatthat_record, and repeat all the way until thatthatthatthatthatthat.PreviousSOPNum == Null.
And print out all the info from
firstSOP (),
that_record (invoice),
thatthat_record_1 (original order split as backorder), thatthat_record_2 (original order split as backorder),
.........,
thathathathathahtahtahta_record (original order).
Basically I have to list all the Invoices form that customer and plus all the records related to it all the way from initial order. I forgot why they want this report, but, it was crazy. And I am using crystal report, so I don't have the flexibility on SQL statements.