NOTE that you are still referring to the wrong table in the select and group
by clauses if you want the Industry line to show anything but null
TRANSFORM Nz(Sum([Lead Source Analysis].Share),0) AS SumOfShare
SELECT [FORM LISTS].Industry <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
, Sum([Lead SourceAnalysis].Share) AS [Total Of Share]
FROM [Form Lists] LEFT JOIN [Lead Source Analysis]
ON [Form Lists].Industry=[Lead Source Analysis].Industry
GROUP BY [FORM LISTS].Industry <<<<<<<<<<<<<<<<<<<<<<<<<<<<<
PIVOT [Lead Source Analysis].Team In
("1","2","3","4","5","6","7","8","9","10","11","12","13");
If that doesn't work tell us how it fails. Syntax error, wrong results,
etc. If wrong results, what is wrong with the results - please be specific.
You can see what happens, we can't and are dependent on your description to
figure out what is wrong.
(By the way remove the <<<<<<< from the above - I know you know this, but
I have had people leave stuff in like that.)
--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..
I realized that I only answered one part of your question. The
columns
part.
The rows part would require you to have a table of industries that you
could
outer join to the unnamed table that contains your data.
Add the industries table to the query and join it to your other table
Now double click on the join line and select the option that shows all
for
the industries table and only matching for the other table.
--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
news:
[email protected]...
I have a table of Industries and linked it correctly to the table.
When I run the query it adds the correct number of rows but they all
happen to be blank. Any ideas?
SOMETHING like the following.
TRANSFORM CLng(Nz(Count([Lead Source Analysis].[1st Sale]),0)) AS
[CountOf1st Sale]
SELECT INDUSTRIES.Industry
, Count([Lead Source Analysis].[1st Sale]) AS [Total Of 1st Sale]
FROM INDUSTRIES LEFT JOIN [Lead Source Analysis]
ON INDUSTRIES.Industry = [Lead Source Analysis].Industry
GROUP BY INDUSTRIES.Industry
PIVOT [Lead Source Analysis].Team IN (The list of Teams)
Note that I changed the SELECT and GROUP By clauses to use
INDUSTRIES.Industry. If your query still gives you the "wrong" results,
please post the SQL of the query.
--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County- Hide quoted text -
- Show quoted text -
I tried using your copy and changed the relevant parts and it didnt
seem to work.
This is my SQL:
TRANSFORM Nz(Sum([Lead Source Analysis].Share),0) AS SumOfShare
SELECT [Lead Source Analysis].Industry, Sum([Lead Source
Analysis].Share) AS [Total Of Share]
FROM [Form Lists] LEFT JOIN [Lead Source Analysis] ON [Form
Lists].Industry=[Lead Source Analysis].Industry
GROUP BY [Lead Source Analysis].Industry, [Form Lists].Industry
PIVOT [Lead Source Analysis].Team In
("1","2","3","4","5","6","7","8","9","10","11","12","13");