Go Premium for a chance to win a PS4. Enter to Win

x
Solved

# Access 2007 Grouping question

Posted on 2011-03-25
Medium Priority
292 Views
Hello,

I am working on creating a repot.  I need to add grouping to the report.  I know how to group on a field where ther are like terms... ie group on city name..

but... here is my question that I need help on..

I need to add grouping based on a value of a field.....

Each record has a rating number... 1 - 60...

I need to group.. ratings 44-60 togther
35 to 44 together
27 to 34 together
15 to 26 togther
0 to 14 togther

how can I do this grouping...

0
Question by:FaithDan

LVL 16

Expert Comment

ID: 35219446
Use a query with BETWEEN condition

eg:

SELECT * FROM TableName
WHERE Fieldname
BETWEEN 0 AND 14

0

LVL 16

Accepted Solution

Sheils earned 2000 total points
ID: 35219466
How you set it will depend on you report layout.

You may have a series of subreports each with its own query having different between condition

Alternatively you can bundle the between queries into a union query and display the result in single or multiple records report
0

LVL 1

Author Closing Comment

ID: 35219485
thanks...got it...
0

LVL 31

Expert Comment

ID: 35219519
You may group on a calculated field in the query, named Range
Assume the field name: f1

Range: IIf([f1]>=44,"44-60",IIf([f1]>=35,"35-43",IIf([f1]>=27,"27-34",IIf([f1]>=15,"15-26","0-14"))))

0

LVL 19

Expert Comment

ID: 35219538
The group feature in reports (AC2007) can group by 5s 10s 100s 1000s or fixed custom intervals.  You have a variable grouping.  So,

I would create a new field in a query to id the group with a compound IIF statement and group on this ID.  For Example, in QBE grid field name enter:

Group : IIF([Rating] < 14, "Group1",IIF([Rating] < 27, "Group2",IIF([Rating] < 35, "Group3",IIF([Rating] < 45, "Group4", IIF([Rating] < 61, "Group5", "UnGrouped")))))

This new field in your report query can now be used for report grouping.
0

## Featured Post

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Traditionally, the method to display pictures in Access forms and reports is to first download them from URLs to a folder, record the path in a table and then let the form or report pull the pictures from that folder. But why not let Windows retr…
Microsoft Access has a limit of 255 columns in a single table; SQL Server allows tables with over 255 columns, but reading that data is not necessarily simple.  The final solution for this task involved creating a custom text parser and then reading…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
###### Suggested Courses
Course of the Month10 days, 14 hours left to enroll