PC Review


Reply
Thread Tools Rate Thread

Breaking out data

 
 
John Menken
Guest
Posts: n/a
 
      11th Dec 2011
Hi,
I am using Access 2010 and I have a query question.
I have four fields, empID, CourseName, FirstName, and Lastname.
I would like to separate out the data to show the courses that each
person took.

Example:

6 Basics of ABC John Doe
6 Fundamentals of DEF John Doe 2
7 Skilled Writing Carol Adams 1
8 Basics of ABC Eric Morris
8 Fundamentals of DEF Eric Morris
8 Leadership 101 Eric Morris
8 New Manager Basics Eric Morris 4


Can I do this with the use of a Query?
Many thanks.
 
Reply With Quote
 
 
 
 
John W. Vinson
Guest
Posts: n/a
 
      11th Dec 2011
On Sun, 11 Dec 2011 12:08:46 -0800 (PST), John Menken <(E-Mail Removed)>
wrote:

>Hi,
>I am using Access 2010 and I have a query question.
>I have four fields, empID, CourseName, FirstName, and Lastname.
>I would like to separate out the data to show the courses that each
>person took.
>
>Example:
>
>6 Basics of ABC John Doe
>6 Fundamentals of DEF John Doe 2
>7 Skilled Writing Carol Adams 1
>8 Basics of ABC Eric Morris
>8 Fundamentals of DEF Eric Morris
>8 Leadership 101 Eric Morris
>8 New Manager Basics Eric Morris 4
>
>
>Can I do this with the use of a Query?
>Many thanks.


How would you like to see the result? What you posted does show the name and
the course; I take it that's not what you want.

If you want to see

John Doe Basics of ABC, Fundamentals of DEF

then you'll need a Query with the help of a little bit of VBA code; there's
sample code at http://www.mvps.org/access/modules/mdl0004.htm.

If instead you want a display like

John Doe
Basics of ABC
Fundamentals of DEF
Carol Adams
Skilled Writing
Eric Morris
<etc>

then your best bet would be to create a Report based on the table (or a query
of the table), using the report's Sorting and Grouping to group by EmpID; put
the empID and name in the group header and the course name in the detail
section.
--

John W. Vinson [MVP]
Microsoft's replacements for these newsgroups:
http://social.msdn.microsoft.com/For...-US/accessdev/
http://social.answers.microsoft.com/.../en-US/addbuz/
and see also http://www.utteraccess.com
 
Reply With Quote
 
John Menken
Guest
Posts: n/a
 
      12th Dec 2011
Thank you.
I should've been a little more precise in what I was describing.
I want to see a report that looks like what I show above with a number
after the last record of each group showing the number of courses each
person took.
John Doe took two courses, for example, and Eric Morris took four
courses, but Carol Adams only took one course.

6 Basics of ABC John Doe
6 Fundamentals of DEF John Doe [the number 2 would go here since Doe
took 2 courses]
7 Skilled Writing Carol Adams [the number 1 would go here since
Adams took 1 course]
8 Basics of ABC Eric Morris
8 Fundamentals of DEF Eric Morris
8 Leadership 101 Eric Morris
8 New Manager Basics Eric Morris [the number 4 would go here since
Morris took 4 courses]

Thank you.
 
Reply With Quote
 
John W. Vinson
Guest
Posts: n/a
 
      12th Dec 2011
On Mon, 12 Dec 2011 05:44:31 -0800 (PST), John Menken <(E-Mail Removed)>
wrote:

>Thank you.
>I should've been a little more precise in what I was describing.
>I want to see a report that looks like what I show above with a number
>after the last record of each group showing the number of courses each
>person took.
>John Doe took two courses, for example, and Eric Morris took four
>courses, but Carol Adams only took one course.
>
>6 Basics of ABC John Doe
>6 Fundamentals of DEF John Doe [the number 2 would go here since Doe
>took 2 courses]
>7 Skilled Writing Carol Adams [the number 1 would go here since
>Adams took 1 course]
>8 Basics of ABC Eric Morris
>8 Fundamentals of DEF Eric Morris
>8 Leadership 101 Eric Morris
>8 New Manager Basics Eric Morris [the number 4 would go here since
>Morris took 4 courses]
>
>Thank you.


Use a calculated field

CoursesTook: DCount("*", "[yourtable]", "[EmpID] = " & [EmpID])

--

John W. Vinson [MVP]
Microsoft's replacements for these newsgroups:
http://social.msdn.microsoft.com/For...-US/accessdev/
http://social.answers.microsoft.com/.../en-US/addbuz/
and see also http://www.utteraccess.com
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off



Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:10 PM.