A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Nested Query Problem



 
 
Thread Tools Display Modes
  #1  
Old October 27th, 2008, 05:25 PM posted to microsoft.public.access.queries
jimt
external usenet poster
 
Posts: 31
Default 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 02:37 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.