Posted By Ragu Raghavan on 04/30/2012 01:34 PM Query loop to HRHISTORY for the company+employee where fld_nbr = 20 and beg_date < beg_date of current status. The A_value from the most recent one will be the previous status. Maybe use conditional branch/assignment inside the loop to do this ?
var n=0;var fieldName = "";var found = false;for (n=0; n <= 11; n++) { fieldName = eval("Transaction3200_PAD_ITEM_NAMEr" + n); if (fieldName == "Status"){ CurrentStatus = eval("Transaction3200_LOG_NEW_VALUEr" + n); PreviousStatus = eval("Transaction3200_LOG_PRE_VALUEr" + n); found=true; break; }}