Air code is code I typed "off the top of my head" and haven't tested. I may have left out a comma or something.
>Thanks Cindy! Will look into this.
>
>What do you mean by ** Air Code Warning **? That the query built is very long? It would be best if the categories were very short, such as '01'.
>
>Alex
>
>
>>Alejandro,
>>
>>I've done a lot of these. ** Air Code Warning! **
>>
>>
>>SELECT Batch#, Trans#, ;
>> SUM(IIF(Category = "RegTime", GrandChild.Quantity, 0)) AS RegTime_amt, ;
>> SUM(IIF(Category = "Absence", GrandChild.Quantity, 0)) AS Absence_amt, ;
>> ... ;
>> FROM < be sure to include the parent tables with the proper joins > ;
>> INTO CURSOR MyCursor ;
>> GROUP BY Batch#, Trans#
>>
>>
>>I think this will give you the general idea.
>>