Group By

  • Thread starter Thread starter pushrodengine via AccessMonster.com
  • Start date Start date
P

pushrodengine via AccessMonster.com

How would I Group By all except for one possible entry.

Within the query “qryCallâ€, I need to group by all possibilities except for
“Canceled On-sceneâ€.

Thanks
 
How would I Group By all except for one possible entry.

Within the query “qryCallâ€, I need to group by all
possibilities except for “Canceled On-sceneâ€.

Thanks
Create a calculated field
CanceledOnScene: [fieldname] = "Canceled On-scene"

This will return true or false.
 
How would I Group By all except for one possible entry.

Within the query "qryCall", I need to group by all possibilities except for
"Canceled On-scene".

Thanks

Create a calculated field
CanceledOnScene: [fieldname] = "Canceled On-scene"

This will return true or false.

Or you can create a calculated field using iif to change the true/
false to something else.

CanceledOnScene: iif([fieldname] = "Canceled On-scene", "Canceled on
scene", "All other codes")
 
Change the Group By Total Row to Expression, or one of the other choices in
the Totals Combo box.
 
Sorry, my question wasn’t really close to what I actually need.

Within the query “qryCallâ€, I need to Group By all the possibilities in the
field “Detailâ€, except for “Canceled On-sceneâ€.

Instead of trying to list all of the possibilities in the “Criteriaâ€, I would
just like to set the criteria to everything, but “Canceled On-sceneâ€.

Is this possible?
 
Yes:

SELECT ID, DateField, Address, City, Zip, State
FROM tblMyTable
WHERE Detail<>"Canceled On-scene"
GROUP BY ID, DateField, Address, City, Zip, State;

Notice that the Detail field is not in Group By. That's because after add
ing the criteria, I changed "Group By" to "Where". The query wizard then
automatically unchecked the Display check box.
 
possible this would work:

SELECT a.col1, a.col.2, etc.
FROM (SELECT *
FROM YourTable
WHERE NOT (detail ='Canceled On-scene')) AS a
ORDER BY a.detail;
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

How to order report by date? 2
Access Query problem 1
Access Sorting and grouping using multiple tables 0
Access Dcount (multiple criteria) 3
Show zero and not error when division by zero 5
Showing 0's in a group query 4
Desable "Cancel" event 3
Group By 8

Back
Top