I'm working in MS Query and created a query from a table called MONTHLY that sums amounts grouped by account numbers. I use the MS Query window to create the query which generates this SQL statement:
SELECT MONTHLY.ACCOUNT, SUM(MONTHLY.AMOUNT)
FROM TDWT01.MONTHLY MONTHLY
GROUP BY MONTHLY.ACCOUNT
This returns to Excel the data I want to see (although the column heading in Excel for the sum(Amount) columns says "2"). However, when I go back into MS Query to edit the query - the SQL says:
SELECT MONTHLY.ACCOUNT, MONTHLY.AMOUNT
FROM TDWT01.MONTHLY MONTHLY
I lose the SUM and the GROUP BY. It doesn't matter if I create the query using the MS Query window or if I type the SQL code into the SQL window - I still lose the SUM and GROUP BY when I go back into MS Query to edit the query in any way.
It's puzzling - any ideas?
SELECT MONTHLY.ACCOUNT, SUM(MONTHLY.AMOUNT)
FROM TDWT01.MONTHLY MONTHLY
GROUP BY MONTHLY.ACCOUNT
This returns to Excel the data I want to see (although the column heading in Excel for the sum(Amount) columns says "2"). However, when I go back into MS Query to edit the query - the SQL says:
SELECT MONTHLY.ACCOUNT, MONTHLY.AMOUNT
FROM TDWT01.MONTHLY MONTHLY
I lose the SUM and the GROUP BY. It doesn't matter if I create the query using the MS Query window or if I type the SQL code into the SQL window - I still lose the SUM and GROUP BY when I go back into MS Query to edit the query in any way.
It's puzzling - any ideas?