Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / General 2 / May 2007

Tip: Looking for answers? Try searching our database.

Query Question?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Gyetko - 21 May 2007 18:46 GMT
I've posted an example of the Query results I would like returned from
my Data Source.  Basically, I want to have one row for each item, then
have columns for the Months and show the Qty for that Item under the
given Month.  I know I can get my desired results using VBA, but was
wondering if it could be done with straight SQL.  Thank you.

Data Source:
Item      Month     Qty
---------   ---------     ------
12345       1          50
12345       2          65
12345       3          42
67890       1          15
67890       2          11
67890       3          26

Query Results:
Item      QtyMonth1   QtyMonth2   QtyMonth3
---------   ----------------   ----------------   ----------------
12345         50                 65               42
67890         15                 11               26
KARL DEWEY - 21 May 2007 19:17 GMT
How many times are you planning on posting the same thing?
Signature

KARL DEWEY
Build a little - Test a little

> I've posted an example of the Query results I would like returned from
> my Data Source.  Basically, I want to have one row for each item, then
[quoted text clipped - 17 lines]
> 12345         50                 65               42
> 67890         15                 11               26
Brendan Reynolds - 21 May 2007 19:18 GMT
> I've posted an example of the Query results I would like returned from
> my Data Source.  Basically, I want to have one row for each item, then
[quoted text clipped - 17 lines]
> 12345         50                 65               42
> 67890         15                 11               26

I think you can probably get that result using a crosstab query. I can't be
more definite than that, because for some reason I've never really made much
use of crosstab queries. But I think it's probably worth a go ... try using
the crosstab query wizard and see if it can get you what you need?

Signature

Brendan Reynolds

Gyetko - 21 May 2007 19:55 GMT
Sorry for the dups, I was posting using Google Groups and was getting
a message with each post.  I was't able to view them after posting, so
I tried a duplicate and then a different group.  Should've tried
viewing with a reader first.

Thanks for the response, crosstab does work.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.