sportsguy
Finance wiz, Access hack
- Local time
- Yesterday, 21:59
- Joined
- Dec 28, 2004
- Messages
- 363
I have an MS 2010 Access union query running off of a single SQLSERVER 2012 table, and the query runs fine. All the output columns are aligned.
I the first three columns are the fiscal week, location and the invoice number
The next two columns are the invoiced amount, and the Balance remaining,
the final tow column are the prior week's invoiced amount, and the prior week's Remaining Balance.
With a certain invoice number 50 records show up properly, total amounts are in the 40,000 and 10,000 range. . . all good
The issue comes when I create a group by and sum query on the union query and perform a sum of the dollar columns, and the query returns 2Billion and 100Mill as totals. . and for multiple invoices, the deficit sized numbers are repeat exactly for each invoice. . .
Is this a bug or do I need to do something else?
thanks in advance, sportsguy
I the first three columns are the fiscal week, location and the invoice number
The next two columns are the invoiced amount, and the Balance remaining,
the final tow column are the prior week's invoiced amount, and the prior week's Remaining Balance.
Code:
SELECT fiscal week, location, invoice number, Current_WeeK_ Invoiced_Amt, CurrentWeek_Remaining_Balance, 0 as Prior_Week Invoiced_Amt, 0 As prior_ Week_Remaining_Balance . . . .
UNION ALL
SELECT fiscal week, location, invoice number, 0 AS Current_WeeK_ Invoiced_Amt, 0 AS CurrentWeek_Remaining_Balance, Prior_Week Invoiced_Amt, prior_Week_Remaining_Balance . . . .
With a certain invoice number 50 records show up properly, total amounts are in the 40,000 and 10,000 range. . . all good
The issue comes when I create a group by and sum query on the union query and perform a sum of the dollar columns, and the query returns 2Billion and 100Mill as totals. . and for multiple invoices, the deficit sized numbers are repeat exactly for each invoice. . .
Is this a bug or do I need to do something else?
thanks in advance, sportsguy