Question
Acummulating a total using two files
I have two files that I am working with. One file is a lsit
of all our customer orders that contains basic data that has been
estimated. The second file I have is sorted by order number (the
same key as file one) and contains multiple records for each order
that is created once the actual order has been billed. And in the
event that credits or additions to that same order take place, the
number of records for each order number will increase in that
second file.
What I want to do is to move through a recordset that is based on file one. As each record of that recordset is read I want a specific field (amount due) to be subject to logic whereby file 2 is checked to see if an order number exists, and if it does, a loop is performed accumulating a total (amount due) until such time as all records for that order number have been read. I will then <cfoutput> the data records for recordset one from file one with either the estimated or actual amount due.
On our AS400 I know the programmers can set a lower limit to get right to the beginning of the data that is sought. I would be very interested in any ColdFusion technique that is recommended that can accomplish the same thing. I am also thinking that <cfbreak> could be utilized within a loop to quickly exit the sorted list once the order number changes.
I will be creating a list of two thousand records, so getting this program to run as quickly/efficiently as possible is important. Else the program will not be used by our staff. I would be very appreciative of recommendations on the best methods to accomplish what I have outlined. Thank you
What I want to do is to move through a recordset that is based on file one. As each record of that recordset is read I want a specific field (amount due) to be subject to logic whereby file 2 is checked to see if an order number exists, and if it does, a loop is performed accumulating a total (amount due) until such time as all records for that order number have been read. I will then <cfoutput> the data records for recordset one from file one with either the estimated or actual amount due.
On our AS400 I know the programmers can set a lower limit to get right to the beginning of the data that is sought. I would be very interested in any ColdFusion technique that is recommended that can accomplish the same thing. I am also thinking that <cfbreak> could be utilized within a loop to quickly exit the sorted list once the order number changes.
I will be creating a list of two thousand records, so getting this program to run as quickly/efficiently as possible is important. Else the program will not be used by our staff. I would be very appreciative of recommendations on the best methods to accomplish what I have outlined. Thank you