If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Nested Query Problem
I'm trying to create a query with a nested query and I get the dreaded "You
tried to execute a query that does not include the specific expression FISYEBUD as part of an aggreagte function". SELECT Data.FISYEBUD, Data.TRAID, Data.DOCLINNU, Data.PPROCODBUY, Data.APPR, Sum(IIf(Data!ACCOTY=21 And Data![Reference Number] & Data!OCLINNUREF Is Null,Data!AMTDOL,0)) AS [PO Amount], (SELECT Sum([Data]![AMTDOL]) From [Data] As [OldData] Where [Old Data]![TRAID]=[Data]![Reference Number] And [OldData]![DOCLINNU]=[Data]![OCLINNUREF]) AS Spent FROM Data GROUP BY Data.FISYEBUD, Data.TRAID, Data.DOCLINNU, Data.PPROCODBUY, Data.APPR, Data.VENINVONU HAVING (((Data.TRAID) Like "PO*") AND ((Data.VENINVONU)="2008-2009 flu season")) ORDER BY Data.TRAID, Data.DOCLINNU, Data.FISYEBUD; I'm trying to query the amount of funds I have spent during the flu season. -- JimT |
Thread Tools | |
Display Modes | |
|
|