You keep saying something about a subquery in the error message. Are
you posting the entire SQL (query) statement?
IF you are trying to use a subquery in the select clause of a query then
you need to enclose the subquery in parentheses.
SELECT FieldA
, (SELECT Sum(FieldX) FROM SomeTable) as FieldB
FROM SomeTable
'====================================================
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
'====================================================
Can someone PLEASE help me with this problem????
:
No matter what expression I use I get the syntax error. It wants me
close the
subquery in parentheses". I tried to use different combinations and
it will
not accept the syntax.
:
I suggest this --
SELECT ClientID, Sum(Rent) as RentSum FROM [PO 1189-616] GROUP BY
ClientID
Otherwise you will have multiple sums without an identifier.
--
KARL DEWEY
Build a little - Test a little
:
You cannot group by on the aggregate. If you have NO group, use:
SELECT Sum(Rent) as RentSum FROM [PO 1189-616]
That will consider the whole table is a single group. That query
returns
just one row.
If you have a group, make the expression making the group different
than the
aggregate, like:
SELECT Sum(Rent) as RentSum FROM [PO 1189-616] GROUP BY
ClientID
Hoping it may help,
Vanderghast, Access MVP
I have the following expression for a total of a field has has 90
records
with each having a figure of 29.50 in them. I want to total this
field
and
the syntax error is saying "check the subquery's syntax and enclose
the
subquery in parentheses"
SELECT Sum(Rent) as RentSum from [PO 1189-616] Group By Sum(Rent)
where should the parathases go?