PC Review


Reply
Thread Tools Rate Thread

Concatenate work order #'s

 
 
Annette
Guest
Posts: n/a
 
      1st Mar 2011
I have a query that returns the DateWorked, WorkerID, ServiceID,
TotalHours. I would like to get a report that shows on a particular
day, all the ServiceID's a Worker did and for how many hours.

So if the data looked like this (DateWorked, Worker ID, ServiceID and
TotalHours)
01/01/2011 1 99 2
01/01/2011 1 97 4
01/01/2011 1 80 2
01/01/2011 2 99 1
01/01/2011 2 91 3
01/01/2011 2 70 5

The results would be that on 01/01/2011 worker 1 worked 8 hours on
99,97,80 and on 01/01/02011 worker 2 worked 9 hours on 99,91,70.

How can I do this?
 
Reply With Quote
 
 
 
 
Access Developer
Guest
Posts: n/a
 
      1st Mar 2011

"Annette" <(E-Mail Removed)> wrote in message
news:ea7105d6-8485-4756-a586-(E-Mail Removed)...
>I have a query that returns the DateWorked, WorkerID, ServiceID,
> TotalHours. I would like to get a report that shows on a particular
> day, all the ServiceID's a Worker did and for how many hours.
>
> So if the data looked like this (DateWorked, Worker ID, ServiceID and
> TotalHours)
> 01/01/2011 1 99 2
> 01/01/2011 1 97 4
> 01/01/2011 1 80 2
> 01/01/2011 2 99 1
> 01/01/2011 2 91 3
> 01/01/2011 2 70 5
>
> The results would be that on 01/01/2011 worker 1 worked 8 hours on
> 99,97,80 and on 01/01/02011 worker 2 worked 9 hours on 99,91,70.
>
> How can I do this?


Use a Totals Query, with Date, Worker, and Service ID as Group By, Total
Hours as Sum.

Just FYI, "concatenate" in the Access world is normally used to indicate
appending one string to the end of another. You in fact want to Sum (or
Total) the hours each worker worked by Service ID, by Date.


 
Reply With Quote
 
Annette
Guest
Posts: n/a
 
      2nd Mar 2011
Yes, I know to use a sum to get the total hours. That is not what I am
seeking help on. I want to know how I can concatenate the Service
ID's. As in my example above, I want to see that on 01/01/2011, worker
1 worked on service id 99, 97 and 80 -- which is a concatenation. So
in a sense the query I have that lists the 6 detail records, I want
to summarize as two entries on the reports -- showing the date, the
employee, total number of hours and the concatenation of the service
id's they worked on that day.
 
Reply With Quote
 
John W. Vinson
Guest
Posts: n/a
 
      2nd Mar 2011
On Wed, 2 Mar 2011 04:03:01 -0800 (PST), Annette
<(E-Mail Removed)> wrote:

>Yes, I know to use a sum to get the total hours. That is not what I am
>seeking help on. I want to know how I can concatenate the Service
>ID's. As in my example above, I want to see that on 01/01/2011, worker
>1 worked on service id 99, 97 and 80 -- which is a concatenation. So
>in a sense the query I have that lists the 6 detail records, I want
>to summarize as two entries on the reports -- showing the date, the
>employee, total number of hours and the concatenation of the service
>id's they worked on that day.


You'll need to use a bit of VBA to do this. One sample code is
http://www.mvps.org/access/modules/mdl0004.htm
--

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
concatenate won't work TracySLPS Microsoft Excel Worksheet Functions 6 22nd Apr 2009 07:12 PM
Concatenate with ORDER BY clause BillA Microsoft Access Queries 2 30th May 2008 06:19 PM
Concatenate and can grow do not work ken@kcookpcbiz.com Microsoft Access Reports 3 2nd Feb 2008 02:55 AM
Concatenate Doesn't Work for this brad_pitstain@yahoo.com Microsoft Excel Worksheet Functions 0 11th Sep 2006 07:51 PM
Concatenate Function will not work Chuck W Microsoft Excel Misc 4 31st Jan 2005 11:41 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:26 AM.