Air code .... might try
Code:
SELECT [GICS Sector], DAvg("GM","tbl0") AS GmMedianByGicsSector
FROM tbl0
WHERE [GM] Is Not Null
GROUP BY [GICS Sector];
or
Code:
SELECT [GICS Sector], DAvg("GM","tbl0","[GM] Is Not Null") AS GmMedianByGicsSector
FROM tbl0
GROUP BY [GICS Sector];
Looking at your original query, "DAvg("GM","tbl0"," [GICS Sector] = [GICS Sector] AND GM Is Not Null")", the criteria evaluates to
[GICS Sector] = [GICS Sector] AND GM Is Not Null
True .......................................... (the number)
So the criteria is "TRUE", which would avg all of the data for each [GICS Sector].
BTW, I would advise not using spaces in object names....just causes you headaches...