I'm not sure how to go about this. I have a table such as the one below.
EmplID | PayType | PayHours |
1111 | A | 17 |
1111 | B | 32 |
9898 | A | 5 |
6759 | B | 7 |
I need to end up like this in csv format:
EmplID,APayHours,BPayHours
1111,17,32
9898,5,
6759, ,7
I already have all the code I need to just do a straight-forward, one line per type/hour. This is an abbreviated version, but you get the idea. I select into a tmpTable.
If (irrelevant criteria)
{
while select EmplID, PayType, sum(Hours) from TableA
group by EmplName, PayType{
this.doInsertTmp(TableA.EmplId,TableA.PayCostType,TableA.Hours);
}
}(there is a lovely "else" statement).
Then I pop it into a text file. All of that is working fine, even if my abbreviated sample looks weird.
while select tmpTableA
io.write( tmpTableA.EmplID,
tmpTableA.PayCostType,
tmpTableA.Hours
);
I just need to figure out how to do the calculation that I need to do. I'm banging my head against the wall here. Thanks all.