I have a cross-tab query that contains the Fiscal Quarters (1, 2, 3, 4) and the total sales for that quarter based on sales account code. I need a row with codes combined with the name "Sales" and a total for each quarter. Some codes are in order (1,2,3,4) others are not (6,9,10, 15). How can I combine multiple records into one?
AcctCode AcctCodeName Total Date
1 Sales-Parts $4 1/1/2006
2 Sales-Service $5 4/2/2006
3 Sales-Internal $5 7/1/2006
4 Sales-Other $5 12/23/2006
I'm using the following code to mark each detail with a quarter number but I'm lost on combining each record into one.
if Month ({AR_InvoiceHistoryHeader.TransactionDate}) <= 3
then "1Q"
else
if Month ({AR_InvoiceHistoryHeader.TransactionDate}) <= 6
then "2Q"
else
if Month ({AR_InvoiceHistoryHeader.TransactionDate}) <= 9
then "3Q"
else
if Month ({AR_InvoiceHistoryHeader.TransactionDate}) <= 12
then "4Q"
Thanks for any help you can provide.
AcctCode AcctCodeName Total Date
1 Sales-Parts $4 1/1/2006
2 Sales-Service $5 4/2/2006
3 Sales-Internal $5 7/1/2006
4 Sales-Other $5 12/23/2006
I'm using the following code to mark each detail with a quarter number but I'm lost on combining each record into one.
if Month ({AR_InvoiceHistoryHeader.TransactionDate}) <= 3
then "1Q"
else
if Month ({AR_InvoiceHistoryHeader.TransactionDate}) <= 6
then "2Q"
else
if Month ({AR_InvoiceHistoryHeader.TransactionDate}) <= 9
then "3Q"
else
if Month ({AR_InvoiceHistoryHeader.TransactionDate}) <= 12
then "4Q"
Thanks for any help you can provide.