Vaishak
Paste the following over the SQL (in MS Query) and run the query (usually just by clicking the OK button in the SQL window):
You need to include every field in the GROUP BY clause that isn't an aggregate function (ie the SUM() field is the only one you leave out of the group by). Also, whilst Excel records field names with spaces in ``, these often cause errors once a manual amendment is made to the SQL (hence I've replaced with [] brackets). Since you only have one table (ie there are no joins in the query) you don't actually need to prefix each field with the table name (ie `'Delta Report Data$'`) however, I have retained this, but used an alias of T instead (it's easier and shorter to read).
Hope this helps!
Richard
Bookmarks