Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Grouping Fields

Status
Not open for further replies.

ScubaStevo

Programmer
May 4, 2002
132
AU
Hi

I have a table with 4 fields and I would like to display all the records from the table grouped by each field. That is, list all records from the first field, then list all from the second and so on rather than listing each record with the 4 fields on each line.
Or in other words, having a detail section for each field.

Cheers, Stevo
 
personally, I would use a query to organise the data the correct format, and then use the report bound to the query to display it...

sounds like you want to just combine the 4 fields into 1 field, so probably a union query, with a field name as another field so you can group on that to show all records in each field...

--------------------
Procrastinate Now!
 
I don't think you'll be able to have a detail section ber each field, this seems a bit "unnormalized", so I'd think of a union query that could probably go as recordsource of the report:

[tt]select field1, 1 as mysort from mytable
union select field2, 2 as mysort from mytable
union select field3, 3 as mysort from mytable
union select field4, 4 as mysort from mytable
order by 2,1[/tt]

Threw in a sorting field, so they are grouped.

Roy-Vidar
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top