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 » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Allen Brown please - Crosstab



 
 
Thread Tools Display Modes
  #1  
Old February 15th, 2007, 07:46 PM posted to microsoft.public.access.queries
mhmaid
external usenet poster
 
Posts: 42
Default Allen Brown please - Crosstab

I am trying to use the example you shown here
http://allenbrowne.com/ser-67.html
but unfortunatly the columns are coming without value.

any help please.
I have tried using the norwind as you mentioned.
  #2  
Old February 15th, 2007, 07:49 PM posted to microsoft.public.access.queries
mhmaid
external usenet poster
 
Posts: 42
Default Allen Brown please - Crosstab

of course i am talking about"
Specify column headings
  #3  
Old February 15th, 2007, 10:45 PM posted to microsoft.public.access.queries
Duane Hookom
external usenet poster
 
Posts: 7,177
Default Allen Brown please - Crosstab

It's almost impossible to answer a crosstab related question without seeing
your SQL and knowing something about your data.

--
Duane Hookom
Microsoft Access MVP


"mhmaid" wrote:

I am trying to use the example you shown here
http://allenbrowne.com/ser-67.html
but unfortunatly the columns are coming without value.

any help please.
I have tried using the norwind as you mentioned.

  #4  
Old February 16th, 2007, 03:30 AM posted to microsoft.public.access.queries
mhmaid
external usenet poster
 
Posts: 42
Default Allen Brown please - Crosstab

Thank you mr Duane Hookom for reply.
I am talking about the example shown on the link
http://allenbrowne.com/ser-67.html
which is using the sample database northwind to make a crosstab query.

this is the SQL I am trying to use.

TRANSFORM Sum([Order Details].Quantity) AS SumOfQuantity
SELECT Products.ProductID, Products.ProductName, Sum([Order
Details].Quantity) AS Total
FROM Products INNER JOIN ((Employees INNER JOIN Orders ON
Employees.EmployeeID = Orders.EmployeeID) INNER JOIN [Order Details] ON
Orders.OrderID = [Order Details].OrderID) ON Products.ProductID = [Order
Details].ProductID
GROUP BY Products.ProductID, Products.ProductName
PIVOT Employees.LastName In ("Buchanan, Steven","Callahan, Laura","Davolio,
Nancy","Dodsworth, Anne","Fuller, Andrew","King, Robert","Leverling,
Janet","Peacock, Margaret","Suyama, Michael");

but unfortunately I am getting the wanted column headings with NO value.

as you can see , I have added the follwing :

"Buchanan, Steven", "Callahan, Laura", "Davolio, Nancy", "Dodsworth, Anne",
"Fuller, Andrew", "King, Robert", "Leverling, Janet", "Peacock, Margaret",
"Suyama, Michael"

to the column heading property of the query as instructed in the above link
by mr allen brown, and got the above sql.






  #5  
Old February 16th, 2007, 07:46 AM posted to microsoft.public.access.queries
Duane Hookom
external usenet poster
 
Posts: 7,177
Default Allen Brown please - Crosstab

The LastName field doesn't also contain first names. Your Column Headings
property needs to reflect values from the PIVOT field/expression.
I fixed two of these and left the remainder for you to fix:

PIVOT Employees.LastName In ("Buchanan","Callahan","Davolio,
Nancy","Dodsworth, Anne","Fuller, Andrew","King, Robert","Leverling,
Janet","Peacock, Margaret","Suyama, Michael");

--
Duane Hookom
Microsoft Access MVP


"mhmaid" wrote:

Thank you mr Duane Hookom for reply.
I am talking about the example shown on the link
http://allenbrowne.com/ser-67.html
which is using the sample database northwind to make a crosstab query.

this is the SQL I am trying to use.

TRANSFORM Sum([Order Details].Quantity) AS SumOfQuantity
SELECT Products.ProductID, Products.ProductName, Sum([Order
Details].Quantity) AS Total
FROM Products INNER JOIN ((Employees INNER JOIN Orders ON
Employees.EmployeeID = Orders.EmployeeID) INNER JOIN [Order Details] ON
Orders.OrderID = [Order Details].OrderID) ON Products.ProductID = [Order
Details].ProductID
GROUP BY Products.ProductID, Products.ProductName
PIVOT Employees.LastName In ("Buchanan, Steven","Callahan, Laura","Davolio,
Nancy","Dodsworth, Anne","Fuller, Andrew","King, Robert","Leverling,
Janet","Peacock, Margaret","Suyama, Michael");

but unfortunately I am getting the wanted column headings with NO value.

as you can see , I have added the follwing :

"Buchanan, Steven", "Callahan, Laura", "Davolio, Nancy", "Dodsworth, Anne",
"Fuller, Andrew", "King, Robert", "Leverling, Janet", "Peacock, Margaret",
"Suyama, Michael"

to the column heading property of the query as instructed in the above link
by mr allen brown, and got the above sql.






  #6  
Old February 16th, 2007, 02:26 PM posted to microsoft.public.access.queries
mhmaid
external usenet poster
 
Posts: 42
Default Allen Brown please - Crosstab

You are right and thank you very much for help . it worked .


 




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 04:43 PM.


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