PC Review


Reply
Thread Tools Rate Thread

Moving data from one table to another

 
 
brownti via AccessMonster.com
Guest
Posts: n/a
 
      13th Dec 2007
I have a query that produces results like those below:

JobID | Length | Qty
1 8 2
1 7 2
1 7 2
1 6 2
1 8 2
2 7 2
2 6 2

I would like the results listed in a new table like such:

JobID | 6 | 7 | 8
1 2 4 4
2 2 2 0

How can this be accomplished? I am very new to Access. Thanks for any help.

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...eries/200712/1

 
Reply With Quote
 
 
 
 
Michel Walsh
Guest
Posts: n/a
 
      13th Dec 2007
Make a crosstab query. The query wizard should be fine. Use JobID as GROUP,
aggregate with SUM over qty, and use Length as PIVOT.

Iin case the query wizard would not 'cooperate' as you like it,

the SQL view of your crosstab query should look like:



TRANSFORM SUM(qty)
SELECT jobID
FROM yourTableNameHere
GROUP BY jobID
PIVOT length


You can paste that code in the SQL view of a new query, change the table
name for yours, and switch back in design view to see how you could have
done it, graphically.



Hoping it may help,
Vanderghast, Access MVP



"brownti via AccessMonster.com" <u31540@uwe> wrote in message
news:7ca1843ccc14f@uwe...
>I have a query that produces results like those below:
>
> JobID | Length | Qty
> 1 8 2
> 1 7 2
> 1 7 2
> 1 6 2
> 1 8 2
> 2 7 2
> 2 6 2
>
> I would like the results listed in a new table like such:
>
> JobID | 6 | 7 | 8
> 1 2 4 4
> 2 2 2 0
>
> How can this be accomplished? I am very new to Access. Thanks for any
> help.
>
> --
> Message posted via AccessMonster.com
> http://www.accessmonster.com/Uwe/For...eries/200712/1
>



 
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
Update one field from one table to another field in another table. Fox Microsoft Access Forms 2 15th Aug 2009 05:09 PM
Apartment Moving, Office Moving, Commercial Moving, Moving Companiesin your area. linkswanted Microsoft C# .NET 0 6th Jan 2008 05:46 AM
Free Moving Estimate, Local Movers, Long Distance Moving, PackingSupplies, Storage Rental, Home Moving, Apartment Moving, Office Moving,Commercial Moving linkswanted Microsoft ASP .NET 0 6th Jan 2008 05:45 AM
Moving Outlook to another PC, and moving data files to another location /mel/ Microsoft Outlook 3 24th Jun 2006 03:39 PM
moving multiple fields in one table to one field in another table =?Utf-8?B?UmVkIENlbnRyZQ==?= Microsoft Access Getting Started 1 24th May 2006 10:51 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:46 AM.