A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Setting Up & Running Reports
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

group/sort on 2 fields w/ same value



 
 
Thread Tools Display Modes
  #1  
Old January 11th, 2008, 08:07 PM posted to microsoft.public.access.reports
Paul
external usenet poster
 
Posts: 1,312
Default group/sort on 2 fields w/ same value

I need to have my report group/sort multiple records based on two different
fields having the same value.

It's ticketing system and there is a Primary and Secondary individual
assigned to each ticket.

I'm trying to build a report that will group and list all records where an
individual is listed as EITHER the Primary OR Secondary. This will,
obviously, end up listing some ticket records twice and that is okay and what
I need (listed once under the Primary resource and again under the Secondary
resource).

Help?
  #2  
Old January 11th, 2008, 08:31 PM posted to microsoft.public.access.reports
Golfinray
external usenet poster
 
Posts: 1,597
Default group/sort on 2 fields w/ same value

Have a main form and 2 subforms. The primary and secondary would be subforms.
The subforms would go in the body of the report. Link master and child fields
to the main form (On the data tab in main form properties.) Set the header
property to force new page after or before section (depending on how you
format it) and it will print none. either, or both names on each page of the
report. You can then move the subforms around until you get the look you want.

"Paul" wrote:

I need to have my report group/sort multiple records based on two different
fields having the same value.

It's ticketing system and there is a Primary and Secondary individual
assigned to each ticket.

I'm trying to build a report that will group and list all records where an
individual is listed as EITHER the Primary OR Secondary. This will,
obviously, end up listing some ticket records twice and that is okay and what
I need (listed once under the Primary resource and again under the Secondary
resource).

Help?

  #3  
Old January 11th, 2008, 10:36 PM posted to microsoft.public.access.reports
Marshall Barton
external usenet poster
 
Posts: 5,361
Default group/sort on 2 fields w/ same value

Paul wrote:

I need to have my report group/sort multiple records based on two different
fields having the same value.

It's ticketing system and there is a Primary and Secondary individual
assigned to each ticket.

I'm trying to build a report that will group and list all records where an
individual is listed as EITHER the Primary OR Secondary. This will,
obviously, end up listing some ticket records twice and that is okay and what
I need (listed once under the Primary resource and again under the Secondary
resource).



Reports always start with the data. In this case you need a
union query to unravel the primary and secondary. I think
there is more to what you want than just this, but it should
get you started.

SELECT P.TicketNum, P.Primary, P.otherfield
FROM table As P
UNION
SELECT S.TicketNum, S.Secondary, S.otherfield
FROM table As S INNER JOIN table As X
ON S.Secondary = X.Primary
WHERE S.TicketNum Is Null

--
Marsh
MVP [MS Access]
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 02:23 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.