Rik_StHelens
Registered User.
- Local time
- Today, 06:39
- Joined
- Sep 15, 2009
- Messages
- 164
you tried to execute a query that does not include "" as part of the aggregate
Hi,
I have keep getting the error message "you tried to execute a query that does not include CUSTOMER as part of the aggregate function"
I've had a nose around the net but not found any solutions so thought i'd post.
Here is the SQL:
SELECT TRNSTK.CUSTOMER, TRNSTK.INVDATE, TRNSTK.STCODE, STOCK.SECTION, STOCK.PROFILE, STOCK.RIM, TRNSTK.SUMCODE, TRNSTK.MANUFCTR, TRNSTK.QUANTITY, VANRUN.DESCRIPN, Sum(IIf(TRNSTK.MANUFCTR="HA",1,0)) AS [No of Hankook], Sum(IIf(TRNSTK.MANUFCTR<>"HA",1,0)) AS [No of Non Hankook]
FROM (TRNSTK INNER JOIN VANRUN ON TRNSTK.VAN = VANRUN.NUMBER) INNER JOIN STOCK ON TRNSTK.STCODE = STOCK.STCODE
WHERE (((TRNSTK.CUSTOMER)="PRO002") AND ((TRNSTK.SUMCODE)="A" Or (TRNSTK.SUMCODE)="B")) OR (((TRNSTK.SUMCODE)="C" Or (TRNSTK.SUMCODE)="D")) OR (((TRNSTK.SUMCODE)="E" Or (TRNSTK.SUMCODE)="F")) OR (((TRNSTK.SUMCODE)="G" Or (TRNSTK.SUMCODE)="H")) OR (((TRNSTK.SUMCODE)="I" Or (TRNSTK.SUMCODE)="J")) OR (((TRNSTK.SUMCODE)="K")) OR (((TRNSTK.SUMCODE)="I"));
Thanks for your time.
Hi,
I have keep getting the error message "you tried to execute a query that does not include CUSTOMER as part of the aggregate function"
I've had a nose around the net but not found any solutions so thought i'd post.
Here is the SQL:
SELECT TRNSTK.CUSTOMER, TRNSTK.INVDATE, TRNSTK.STCODE, STOCK.SECTION, STOCK.PROFILE, STOCK.RIM, TRNSTK.SUMCODE, TRNSTK.MANUFCTR, TRNSTK.QUANTITY, VANRUN.DESCRIPN, Sum(IIf(TRNSTK.MANUFCTR="HA",1,0)) AS [No of Hankook], Sum(IIf(TRNSTK.MANUFCTR<>"HA",1,0)) AS [No of Non Hankook]
FROM (TRNSTK INNER JOIN VANRUN ON TRNSTK.VAN = VANRUN.NUMBER) INNER JOIN STOCK ON TRNSTK.STCODE = STOCK.STCODE
WHERE (((TRNSTK.CUSTOMER)="PRO002") AND ((TRNSTK.SUMCODE)="A" Or (TRNSTK.SUMCODE)="B")) OR (((TRNSTK.SUMCODE)="C" Or (TRNSTK.SUMCODE)="D")) OR (((TRNSTK.SUMCODE)="E" Or (TRNSTK.SUMCODE)="F")) OR (((TRNSTK.SUMCODE)="G" Or (TRNSTK.SUMCODE)="H")) OR (((TRNSTK.SUMCODE)="I" Or (TRNSTK.SUMCODE)="J")) OR (((TRNSTK.SUMCODE)="K")) OR (((TRNSTK.SUMCODE)="I"));
Thanks for your time.