By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,669 Members | 2,203 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,669 IT Pros & Developers. It's quick & easy.

Keep original field name in a group by query

P: n/a
Is there a switch or a setting in Access so that a group by query
doesn't return a field name SumOf(original field name)? Especially
when you chain multiple queries together you'd get SumOfSumOfSumOf....
Anyone know? TIA.
Nov 12 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
In the Query Grid of your Totals Query, precede the field name of the summed
field by itself and a colon. For a totals query on the Order Details in
Northwind.MDB, that gave me the SQL:

SELECT [Order Details].OrderID, Sum([Order Details].Quantity) AS Quantity
FROM [Order Details]
GROUP BY [Order Details].OrderID;

And running the query showed "Quantity" as the column header, where the
normal totals query gave the following SQL:

SELECT [Order Details].OrderID, Sum([Order Details].Quantity) AS
SumOfQuantity
FROM [Order Details]
GROUP BY [Order Details].OrderID;

and showed "SumOfQuantity" as the column header.

Larry Linson
Microsoft Access MVP
"Louis" <lo*******@lycos.com> wrote in message
news:13************************@posting.google.com ...
Is there a switch or a setting in Access so that a group by query
doesn't return a field name SumOf(original field name)? Especially
when you chain multiple queries together you'd get SumOfSumOfSumOf....
Anyone know? TIA.

Nov 12 '05 #2

P: n/a
Hi Larry,
Unfortunately, this is exactly what I don't want to do. Some queries
can easily have 10, 20 fields and assigning a new field name (followed
by a colon) is time consuming and tedious. Is there a feature (a
check box or something equivalent) that let's Access group by queries
return the original field name? This should be an option to users if
it's not available. TIA

"Larry Linson" <bo*****@localhost.not> wrote in message news:<Pw******************@nwrddc03.gnilink.net>.. .
In the Query Grid of your Totals Query, precede the field name of the summed
field by itself and a colon. For a totals query on the Order Details in
Northwind.MDB, that gave me the SQL:

SELECT [Order Details].OrderID, Sum([Order Details].Quantity) AS Quantity
FROM [Order Details]
GROUP BY [Order Details].OrderID;

And running the query showed "Quantity" as the column header, where the
normal totals query gave the following SQL:

SELECT [Order Details].OrderID, Sum([Order Details].Quantity) AS
SumOfQuantity
FROM [Order Details]
GROUP BY [Order Details].OrderID;

and showed "SumOfQuantity" as the column header.

Larry Linson
Microsoft Access MVP
"Louis" <lo*******@lycos.com> wrote in message
news:13************************@posting.google.com ...
Is there a switch or a setting in Access so that a group by query
doesn't return a field name SumOf(original field name)? Especially
when you chain multiple queries together you'd get SumOfSumOfSumOf....
Anyone know? TIA.

Nov 12 '05 #3

P: n/a
If it is an option, I am not aware of it. Sometimes things are just more
work than we'd like.

Sorry, but I'm not a good channel to get requirements to Microsoft. If I can
find one, I'll post a followup.

Larry Linson
Microsoft Access MVP

"Louis" <lo*******@lycos.com> wrote in message
news:13**************************@posting.google.c om...
Hi Larry,
Unfortunately, this is exactly what I don't want to do. Some queries
can easily have 10, 20 fields and assigning a new field name (followed
by a colon) is time consuming and tedious. Is there a feature (a
check box or something equivalent) that let's Access group by queries
return the original field name? This should be an option to users if
it's not available. TIA

"Larry Linson" <bo*****@localhost.not> wrote in message

news:<Pw******************@nwrddc03.gnilink.net>.. .
In the Query Grid of your Totals Query, precede the field name of the summed field by itself and a colon. For a totals query on the Order Details in
Northwind.MDB, that gave me the SQL:

SELECT [Order Details].OrderID, Sum([Order Details].Quantity) AS Quantity FROM [Order Details]
GROUP BY [Order Details].OrderID;

And running the query showed "Quantity" as the column header, where the
normal totals query gave the following SQL:

SELECT [Order Details].OrderID, Sum([Order Details].Quantity) AS
SumOfQuantity
FROM [Order Details]
GROUP BY [Order Details].OrderID;

and showed "SumOfQuantity" as the column header.

Larry Linson
Microsoft Access MVP
"Louis" <lo*******@lycos.com> wrote in message
news:13************************@posting.google.com ...
Is there a switch or a setting in Access so that a group by query
doesn't return a field name SumOf(original field name)? Especially
when you chain multiple queries together you'd get SumOfSumOfSumOf....
Anyone know? TIA.

Nov 12 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.