Re: Problem with Embeded Queries
- From: "Wayne Morgan" <comprev_gothroughthenewsgroup@xxxxxxxxxxx>
- Date: Fri, 29 Jul 2005 00:21:10 GMT
Try using the Domain Aggregate functions instead of the embedded query.
DSum()
DMax()
I believe the examples in the help file only show one limiter in the "where"
part of the function, but it will accept And/Or statements to chain together
more than one limiter. Also, the field name in the first part can be an
equation but it still has to be enclosed in quotes. The Domain Aggregate
function will run the equation.
--
Wayne Morgan
MS Access MVP
"John Ortt" <JohnOrtt@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:42e8e276_1@xxxxxxxxxxxxxxxxxxxxxxxxx
> Hi there,
>
> I am trying to do a two level embeded query but it is causing Dr Watson
> errors.
>
> The line which is causing the problem is:
>
> CFCDeci: (Select sum (FlexChangeDeci) FROM [qryFlexi] as [qryFlexi2] WHERE
> ([qryFlexi2].[DateID] <= [qryFlexi].[DateID]) and ([qryFlexi2].[DateID] >=
> [qryFlexi].[PrevFlex]);)
>
> specifically ([qryFlexi2].[DateID] >= [qryFlexi].[PrevFlex]) as it works
> when I remove this.
>
> Prev Flexi was defined in an earlier query with another embeded query,
> could
> this be what is causing the problem?
> The code for PrevFlex is below:
>
> PrevFlex: (Select max (dateID) FROM [tblflexi] as Temp WHERE
> [temp].[dateid]
> <= [qrytimes].[dateid])
>
> Any help would be gratefully appreciated.
>
> Thanks,
>
> John.
>
> P.S. The rest of the SQL can be posted if it is of help.....
>
>
.
- References:
- Problem with Embeded Queries
- From: John Ortt
- Problem with Embeded Queries
- Prev by Date: Re: Variable Pointers
- Next by Date: Re: How to make all access to linked table read-only
- Previous by thread: Problem with Embeded Queries
- Next by thread: creating pivot tables in Excel from Access
- Index(es):
Relevant Pages
|