Crosstab Query based on 2 Combo Boxes. How?

N

Nathan Lars

Your knowledge and help would be very appreciated.
I have a db to keep track of projects and their status towards completion.
I need to create a summary report that that shows the number of projects for
each department and the number of these same projects and what
phase(Requested, Assessment, RFP...). So the the total number of projects
can be displayed so that you can quickly see the number of projects for each
department for each phase. It would look somthing like this:
Requested Assessment RFP Execution Completed
Totals
Dept.1 6 3 3 5
8 25
Dept.2 1 1
4 6
Dept.3 2 4 6
12 24
Totals 9 4 7 11
24 110

The top row and side columns are 2 Combo Boxes on the project db Form. The
project phases would be across the top and who the project is for would be
listed on the left side. So if a project on the Form has "Dept.2" selected
in one Combo Box and "Assessment" selected on the other Combo Box, the
Crosstab Query would show it. Likewise, if Dept.2's project in the Requested
phase was moved to the Assessment phase, Dept.2's Requested number field
would be empty and it's Assessment Field would show a total of 2.

My problem is that I can't get the Departments to list as rows along the
left side of the Crosstab Query. Am I not using the crosstab correctly?
Should I be going about this diffently? You are dealing with someone who has
a basic understanding of access but is eager to learn.

Once this is done I would like to set up hyperlinks for each field total to
allow you to drill down to more reports for greater details if needed.
 
N

Nathan Lars

Sorry, that wasn't easy to read. Let me try it again...

Req Asmt RFP Exe Comp Totals
Dept.1 6 3 3 5 8 25
Dept.2 1 1 4 6
Dept.3 2 4 6 12 24
Totals 9 4 7 11 24 110
 
K

KARL DEWEY

Ok, first create a select query that outputs all the fields you have shown --
Dept, Activity, etc.
Open the query in design view, click on menu VIEW - SQL View, highlight all,
copy, and paste in a post.
 
N

Nathan Lars

That's my problem. When I try to create a query using the wizard from the 2
Combo boxes on the form it says I "You have chosen fields from these Tables:
Company, Status: One or more of the tables isn't related to the others.
Click OK to edit system relationships. ..." When I create a relationship
between the Combo Boxes and try to recreate the crosstab with the Status
fields(Requested, Assessment...) as the column headers and Company
fields(Dept.1, Dept.2...) as the row headers it doesn't work the way I
wanted. It only places column headers: one for Status and one for Company
with no fields below them. Does the query need another table for it to place
the new data?

There is no actual table in my database with the numbers in the theoretical
table shown below. The I was hoping to have the crosstab query automatically
populate those fields (under the column headers labelled Requested,
Assessment, RFP... and across from the row headers labelled Dept.1,
Dept.2...) with only counts from the "110" records from my primary table.

I apologize if this is clear as mud.
 
N

Nathan Lars

SELECT Company.Company, Status.Priority
FROM Company INNER JOIN Status ON Company.Company = Status.Priority;
 
K

KARL DEWEY

I do not understand the query uou posted. How is Company to equal Priority?
Your orginal post has departments, not companies.
Post the table sturcture with field names and datatype.
Post sample data from each table.
 
K

KARL DEWEY

The top row and side columns are 2 Combo Boxes on the project db Form. The
project phases would be across the top and who the project is for would be
listed on the left side. So if a project on the Form has "Dept.2" selected
in one Combo Box and "Assessment" selected on the other Combo Box, the
Crosstab Query would show it.
I just re-read your first post and it seems like your data is in a
spreadsheet format and you want combos to pull the data. If that is the case
I do not think it can be done until you reformat the tables.
As I said earlier show the sample data and table structure. And post the
form name and the names of the combo boxes.
 
N

Nathan Lars

You have been very helpful. I am sorry for not responding sooner. You were
right, the names did not match. I have corrected that and here is the query
in SQL as you requested:

SELECT [SAMPLE Install Schedule Table Data].[Project ID], [SAMPLE Install
Schedule Table Data].[Project Name], [SAMPLE Install Schedule Table
Data].[Business Unit], [SAMPLE Install Schedule Table Data].[Project Status],
[SAMPLE Install Schedule Table Data].[Percent Complete]
FROM [SAMPLE Install Schedule Table Data];

Here is the main table with sample data:
Project ID Project Name Business Unit Project Status Percent
Complete
CP-07-0001-A Site Project 1 Dept.1 Requested
FP-07-0001-A Site Project 2 Dept.3 RFP
CP-07-0002-A Site Project 3 Dept.1 RFP
SC-07-0001-A Site Project 4 Dept.4 Assessment
SC-07-0002-A Site Project 5 Dept.4 Completed
FP-07-0002-A Site Project 6 Dept.3 Execution
FP-07-0003-A Site Project 7 Dept.3 Completed
SC-07-0003-A Site Project 8 Dept.4 Completed
FP-07-0004-A Site Project 9 Dept.3 RFP
CP-07-0003-A Site Project 10 Dept.1 Requested
CP-07-0004-A Site Project 11 Dept.1 Requested
SC-07-0004-A Site Project 12 Dept.4 Requested
SC-07-0005-A Site Project 13 Dept.4 Pending
CP-07-0005-A Site Project 14 Dept.2 Execution
SC-07-0006-A Site Project 15 Dept.4 RFP

Below is the table for the Business Unit combo box on the form:
Business Unit

Dept.1
Dept.2
Dept.3
Dept.4

Below is the table for the Project Status combo box on the form:
Phase

Requested
Assessment
RFP
Pending
Execution
Completed
 
K

KARL DEWEY

Try this --
TRANSFORM Count([SAMPLE Install Schedule Table Data].[Project Status]) AS
[CountOfProject Status]
SELECT [SAMPLE Install Schedule Table Data].[Business Unit], Count([SAMPLE
Install Schedule Table Data].[Project Status]) AS [Total Of Project ID]
FROM [SAMPLE Install Schedule Table Data]
GROUP BY [SAMPLE Install Schedule Table Data].[Business Unit]
PIVOT [SAMPLE Install Schedule Table Data].[Project Status];

--
KARL DEWEY
Build a little - Test a little


Nathan Lars said:
You have been very helpful. I am sorry for not responding sooner. You were
right, the names did not match. I have corrected that and here is the query
in SQL as you requested:

SELECT [SAMPLE Install Schedule Table Data].[Project ID], [SAMPLE Install
Schedule Table Data].[Project Name], [SAMPLE Install Schedule Table
Data].[Business Unit], [SAMPLE Install Schedule Table Data].[Project Status],
[SAMPLE Install Schedule Table Data].[Percent Complete]
FROM [SAMPLE Install Schedule Table Data];

Here is the main table with sample data:
Project ID Project Name Business Unit Project Status Percent
Complete
CP-07-0001-A Site Project 1 Dept.1 Requested
FP-07-0001-A Site Project 2 Dept.3 RFP
CP-07-0002-A Site Project 3 Dept.1 RFP
SC-07-0001-A Site Project 4 Dept.4 Assessment
SC-07-0002-A Site Project 5 Dept.4 Completed
FP-07-0002-A Site Project 6 Dept.3 Execution
FP-07-0003-A Site Project 7 Dept.3 Completed
SC-07-0003-A Site Project 8 Dept.4 Completed
FP-07-0004-A Site Project 9 Dept.3 RFP
CP-07-0003-A Site Project 10 Dept.1 Requested
CP-07-0004-A Site Project 11 Dept.1 Requested
SC-07-0004-A Site Project 12 Dept.4 Requested
SC-07-0005-A Site Project 13 Dept.4 Pending
CP-07-0005-A Site Project 14 Dept.2 Execution
SC-07-0006-A Site Project 15 Dept.4 RFP

Below is the table for the Business Unit combo box on the form:
Business Unit

Dept.1
Dept.2
Dept.3
Dept.4

Below is the table for the Project Status combo box on the form:
Phase

Requested
Assessment
RFP
Pending
Execution
Completed


KARL DEWEY said:
I do not understand the query uou posted. How is Company to equal Priority?
Your orginal post has departments, not companies.
Post the table sturcture with field names and datatype.
Post sample data from each table.
 
N

Nathan Lars

I did this and it changed to a crosstab query. Thanks. When I try to run
the crosstab query ti gives this message:
"The Microsoft Jet database engine does not recognize '[SAMPLE Install
Schedule Table Data].[Project Status]' as a valid field name or expression."

What am I missing?


KARL DEWEY said:
Try this --
TRANSFORM Count([SAMPLE Install Schedule Table Data].[Project Status]) AS
[CountOfProject Status]
SELECT [SAMPLE Install Schedule Table Data].[Business Unit], Count([SAMPLE
Install Schedule Table Data].[Project Status]) AS [Total Of Project ID]
FROM [SAMPLE Install Schedule Table Data]
GROUP BY [SAMPLE Install Schedule Table Data].[Business Unit]
PIVOT [SAMPLE Install Schedule Table Data].[Project Status];

--
KARL DEWEY
Build a little - Test a little


Nathan Lars said:
You have been very helpful. I am sorry for not responding sooner. You were
right, the names did not match. I have corrected that and here is the query
in SQL as you requested:

SELECT [SAMPLE Install Schedule Table Data].[Project ID], [SAMPLE Install
Schedule Table Data].[Project Name], [SAMPLE Install Schedule Table
Data].[Business Unit], [SAMPLE Install Schedule Table Data].[Project Status],
[SAMPLE Install Schedule Table Data].[Percent Complete]
FROM [SAMPLE Install Schedule Table Data];

Here is the main table with sample data:
Project ID Project Name Business Unit Project Status Percent
Complete
CP-07-0001-A Site Project 1 Dept.1 Requested
FP-07-0001-A Site Project 2 Dept.3 RFP
CP-07-0002-A Site Project 3 Dept.1 RFP
SC-07-0001-A Site Project 4 Dept.4 Assessment
SC-07-0002-A Site Project 5 Dept.4 Completed
FP-07-0002-A Site Project 6 Dept.3 Execution
FP-07-0003-A Site Project 7 Dept.3 Completed
SC-07-0003-A Site Project 8 Dept.4 Completed
FP-07-0004-A Site Project 9 Dept.3 RFP
CP-07-0003-A Site Project 10 Dept.1 Requested
CP-07-0004-A Site Project 11 Dept.1 Requested
SC-07-0004-A Site Project 12 Dept.4 Requested
SC-07-0005-A Site Project 13 Dept.4 Pending
CP-07-0005-A Site Project 14 Dept.2 Execution
SC-07-0006-A Site Project 15 Dept.4 RFP

Below is the table for the Business Unit combo box on the form:
Business Unit

Dept.1
Dept.2
Dept.3
Dept.4

Below is the table for the Project Status combo box on the form:
Phase

Requested
Assessment
RFP
Pending
Execution
Completed


KARL DEWEY said:
I do not understand the query uou posted. How is Company to equal Priority?
Your orginal post has departments, not companies.
Post the table sturcture with field names and datatype.
Post sample data from each table.
--
KARL DEWEY
Build a little - Test a little


:

SELECT Company.Company, Status.Priority
FROM Company INNER JOIN Status ON Company.Company = Status.Priority;

:

Ok, first create a select query that outputs all the fields you have shown --
Dept, Activity, etc.
Open the query in design view, click on menu VIEW - SQL View, highlight all,
copy, and paste in a post.
--
KARL DEWEY
Build a little - Test a little


:

Could you walk me through this?

:

Post the SQL of your crosstab.
--
KARL DEWEY
Build a little - Test a little


:

Sorry, that wasn't easy to read. Let me try it again...

Req Asmt RFP Exe Comp Totals
Dept.1 6 3 3 5 8 25
Dept.2 1 1 4 6
Dept.3 2 4 6 12 24
Totals 9 4 7 11 24 110



:

Your knowledge and help would be very appreciated.
I have a db to keep track of projects and their status towards completion.
I need to create a summary report that that shows the number of projects for
each department and the number of these same projects and what
phase(Requested, Assessment, RFP...). So the the total number of projects
can be displayed so that you can quickly see the number of projects for each
department for each phase. It would look somthing like this:
Requested Assessment RFP Execution Completed
Totals
Dept.1 6 3 3 5
8 25
Dept.2 1 1
4 6
Dept.3 2 4 6
12 24
Totals 9 4 7 11
24 110

The top row and side columns are 2 Combo Boxes on the project db Form. The
project phases would be across the top and who the project is for would be
listed on the left side. So if a project on the Form has "Dept.2" selected
in one Combo Box and "Assessment" selected on the other Combo Box, the
Crosstab Query would show it. Likewise, if Dept.2's project in the Requested
phase was moved to the Assessment phase, Dept.2's Requested number field
would be empty and it's Assessment Field would show a total of 2.

My problem is that I can't get the Departments to list as rows along the
left side of the Crosstab Query. Am I not using the crosstab correctly?
Should I be going about this diffently? You are dealing with someone who has
a basic understanding of access but is eager to learn.

Once this is done I would like to set up hyperlinks for each field total to
allow you to drill down to more reports for greater details if needed.
 
K

KARL DEWEY

I assume that [SAMPLE Install Schedule Table Data].[Project Status] was the
name of your table based on your posting - query & sample data.

--
KARL DEWEY
Build a little - Test a little


Nathan Lars said:
I did this and it changed to a crosstab query. Thanks. When I try to run
the crosstab query ti gives this message:
"The Microsoft Jet database engine does not recognize '[SAMPLE Install
Schedule Table Data].[Project Status]' as a valid field name or expression."

What am I missing?


KARL DEWEY said:
Try this --
TRANSFORM Count([SAMPLE Install Schedule Table Data].[Project Status]) AS
[CountOfProject Status]
SELECT [SAMPLE Install Schedule Table Data].[Business Unit], Count([SAMPLE
Install Schedule Table Data].[Project Status]) AS [Total Of Project ID]
FROM [SAMPLE Install Schedule Table Data]
GROUP BY [SAMPLE Install Schedule Table Data].[Business Unit]
PIVOT [SAMPLE Install Schedule Table Data].[Project Status];

--
KARL DEWEY
Build a little - Test a little


Nathan Lars said:
You have been very helpful. I am sorry for not responding sooner. You were
right, the names did not match. I have corrected that and here is the query
in SQL as you requested:

SELECT [SAMPLE Install Schedule Table Data].[Project ID], [SAMPLE Install
Schedule Table Data].[Project Name], [SAMPLE Install Schedule Table
Data].[Business Unit], [SAMPLE Install Schedule Table Data].[Project Status],
[SAMPLE Install Schedule Table Data].[Percent Complete]
FROM [SAMPLE Install Schedule Table Data];

Here is the main table with sample data:
Project ID Project Name Business Unit Project Status Percent
Complete
CP-07-0001-A Site Project 1 Dept.1 Requested
FP-07-0001-A Site Project 2 Dept.3 RFP
CP-07-0002-A Site Project 3 Dept.1 RFP
SC-07-0001-A Site Project 4 Dept.4 Assessment
SC-07-0002-A Site Project 5 Dept.4 Completed
FP-07-0002-A Site Project 6 Dept.3 Execution
FP-07-0003-A Site Project 7 Dept.3 Completed
SC-07-0003-A Site Project 8 Dept.4 Completed
FP-07-0004-A Site Project 9 Dept.3 RFP
CP-07-0003-A Site Project 10 Dept.1 Requested
CP-07-0004-A Site Project 11 Dept.1 Requested
SC-07-0004-A Site Project 12 Dept.4 Requested
SC-07-0005-A Site Project 13 Dept.4 Pending
CP-07-0005-A Site Project 14 Dept.2 Execution
SC-07-0006-A Site Project 15 Dept.4 RFP

Below is the table for the Business Unit combo box on the form:
Business Unit

Dept.1
Dept.2
Dept.3
Dept.4

Below is the table for the Project Status combo box on the form:
Phase

Requested
Assessment
RFP
Pending
Execution
Completed


:

I do not understand the query uou posted. How is Company to equal Priority?
Your orginal post has departments, not companies.
Post the table sturcture with field names and datatype.
Post sample data from each table.
--
KARL DEWEY
Build a little - Test a little


:

SELECT Company.Company, Status.Priority
FROM Company INNER JOIN Status ON Company.Company = Status.Priority;

:

Ok, first create a select query that outputs all the fields you have shown --
Dept, Activity, etc.
Open the query in design view, click on menu VIEW - SQL View, highlight all,
copy, and paste in a post.
--
KARL DEWEY
Build a little - Test a little


:

Could you walk me through this?

:

Post the SQL of your crosstab.
--
KARL DEWEY
Build a little - Test a little


:

Sorry, that wasn't easy to read. Let me try it again...

Req Asmt RFP Exe Comp Totals
Dept.1 6 3 3 5 8 25
Dept.2 1 1 4 6
Dept.3 2 4 6 12 24
Totals 9 4 7 11 24 110



:

Your knowledge and help would be very appreciated.
I have a db to keep track of projects and their status towards completion.
I need to create a summary report that that shows the number of projects for
each department and the number of these same projects and what
phase(Requested, Assessment, RFP...). So the the total number of projects
can be displayed so that you can quickly see the number of projects for each
department for each phase. It would look somthing like this:
Requested Assessment RFP Execution Completed
Totals
Dept.1 6 3 3 5
8 25
Dept.2 1 1
4 6
Dept.3 2 4 6
12 24
Totals 9 4 7 11
24 110

The top row and side columns are 2 Combo Boxes on the project db Form. The
project phases would be across the top and who the project is for would be
listed on the left side. So if a project on the Form has "Dept.2" selected
in one Combo Box and "Assessment" selected on the other Combo Box, the
Crosstab Query would show it. Likewise, if Dept.2's project in the Requested
phase was moved to the Assessment phase, Dept.2's Requested number field
would be empty and it's Assessment Field would show a total of 2.

My problem is that I can't get the Departments to list as rows along the
left side of the Crosstab Query. Am I not using the crosstab correctly?
Should I be going about this diffently? You are dealing with someone who has
a basic understanding of access but is eager to learn.

Once this is done I would like to set up hyperlinks for each field total to
allow you to drill down to more reports for greater details if needed.
 
N

Nathan Lars

Yes, [SAMPLE Install Schedule Table Data] is the main table and [Project
Status] is one of the columns within that table. [Project Status] is
populated by selecting one of the Phases in the [Status] table which only has
6 fields in that one column. This is one of the two dropdowns on the form.

Sorry if I'm not explaining this clearly.

KARL DEWEY said:
I assume that [SAMPLE Install Schedule Table Data].[Project Status] was the
name of your table based on your posting - query & sample data.

--
KARL DEWEY
Build a little - Test a little


Nathan Lars said:
I did this and it changed to a crosstab query. Thanks. When I try to run
the crosstab query ti gives this message:
"The Microsoft Jet database engine does not recognize '[SAMPLE Install
Schedule Table Data].[Project Status]' as a valid field name or expression."

What am I missing?


KARL DEWEY said:
Try this --
TRANSFORM Count([SAMPLE Install Schedule Table Data].[Project Status]) AS
[CountOfProject Status]
SELECT [SAMPLE Install Schedule Table Data].[Business Unit], Count([SAMPLE
Install Schedule Table Data].[Project Status]) AS [Total Of Project ID]
FROM [SAMPLE Install Schedule Table Data]
GROUP BY [SAMPLE Install Schedule Table Data].[Business Unit]
PIVOT [SAMPLE Install Schedule Table Data].[Project Status];

--
KARL DEWEY
Build a little - Test a little


:

You have been very helpful. I am sorry for not responding sooner. You were
right, the names did not match. I have corrected that and here is the query
in SQL as you requested:

SELECT [SAMPLE Install Schedule Table Data].[Project ID], [SAMPLE Install
Schedule Table Data].[Project Name], [SAMPLE Install Schedule Table
Data].[Business Unit], [SAMPLE Install Schedule Table Data].[Project Status],
[SAMPLE Install Schedule Table Data].[Percent Complete]
FROM [SAMPLE Install Schedule Table Data];

Here is the main table with sample data:
Project ID Project Name Business Unit Project Status Percent
Complete
CP-07-0001-A Site Project 1 Dept.1 Requested
FP-07-0001-A Site Project 2 Dept.3 RFP
CP-07-0002-A Site Project 3 Dept.1 RFP
SC-07-0001-A Site Project 4 Dept.4 Assessment
SC-07-0002-A Site Project 5 Dept.4 Completed
FP-07-0002-A Site Project 6 Dept.3 Execution
FP-07-0003-A Site Project 7 Dept.3 Completed
SC-07-0003-A Site Project 8 Dept.4 Completed
FP-07-0004-A Site Project 9 Dept.3 RFP
CP-07-0003-A Site Project 10 Dept.1 Requested
CP-07-0004-A Site Project 11 Dept.1 Requested
SC-07-0004-A Site Project 12 Dept.4 Requested
SC-07-0005-A Site Project 13 Dept.4 Pending
CP-07-0005-A Site Project 14 Dept.2 Execution
SC-07-0006-A Site Project 15 Dept.4 RFP

Below is the table for the Business Unit combo box on the form:
Business Unit

Dept.1
Dept.2
Dept.3
Dept.4

Below is the table for the Project Status combo box on the form:
Phase

Requested
Assessment
RFP
Pending
Execution
Completed


:

I do not understand the query uou posted. How is Company to equal Priority?
Your orginal post has departments, not companies.
Post the table sturcture with field names and datatype.
Post sample data from each table.
--
KARL DEWEY
Build a little - Test a little


:

SELECT Company.Company, Status.Priority
FROM Company INNER JOIN Status ON Company.Company = Status.Priority;

:

Ok, first create a select query that outputs all the fields you have shown --
Dept, Activity, etc.
Open the query in design view, click on menu VIEW - SQL View, highlight all,
copy, and paste in a post.
--
KARL DEWEY
Build a little - Test a little


:

Could you walk me through this?

:

Post the SQL of your crosstab.
--
KARL DEWEY
Build a little - Test a little


:

Sorry, that wasn't easy to read. Let me try it again...

Req Asmt RFP Exe Comp Totals
Dept.1 6 3 3 5 8 25
Dept.2 1 1 4 6
Dept.3 2 4 6 12 24
Totals 9 4 7 11 24 110



:

Your knowledge and help would be very appreciated.
I have a db to keep track of projects and their status towards completion.
I need to create a summary report that that shows the number of projects for
each department and the number of these same projects and what
phase(Requested, Assessment, RFP...). So the the total number of projects
can be displayed so that you can quickly see the number of projects for each
department for each phase. It would look somthing like this:
Requested Assessment RFP Execution Completed
Totals
Dept.1 6 3 3 5
8 25
Dept.2 1 1
4 6
Dept.3 2 4 6
12 24
Totals 9 4 7 11
24 110

The top row and side columns are 2 Combo Boxes on the project db Form. The
project phases would be across the top and who the project is for would be
listed on the left side. So if a project on the Form has "Dept.2" selected
in one Combo Box and "Assessment" selected on the other Combo Box, the
Crosstab Query would show it. Likewise, if Dept.2's project in the Requested
phase was moved to the Assessment phase, Dept.2's Requested number field
would be empty and it's Assessment Field would show a total of 2.

My problem is that I can't get the Departments to list as rows along the
left side of the Crosstab Query. Am I not using the crosstab correctly?
Should I be going about this diffently? You are dealing with someone who has
a basic understanding of access but is eager to learn.

Once this is done I would like to set up hyperlinks for each field total to
allow you to drill down to more reports for greater details if needed.
 
K

KARL DEWEY

by selecting one of the Phases in the [Status] table which only has 6
fields in that one column.
How can your [Status] table have 6 fields in one column?

--
KARL DEWEY
Build a little - Test a little


Nathan Lars said:
Yes, [SAMPLE Install Schedule Table Data] is the main table and [Project
Status] is one of the columns within that table. [Project Status] is
populated by selecting one of the Phases in the [Status] table which only has
6 fields in that one column. This is one of the two dropdowns on the form.

Sorry if I'm not explaining this clearly.

KARL DEWEY said:
I assume that [SAMPLE Install Schedule Table Data].[Project Status] was the
name of your table based on your posting - query & sample data.

--
KARL DEWEY
Build a little - Test a little


Nathan Lars said:
I did this and it changed to a crosstab query. Thanks. When I try to run
the crosstab query ti gives this message:
"The Microsoft Jet database engine does not recognize '[SAMPLE Install
Schedule Table Data].[Project Status]' as a valid field name or expression."

What am I missing?


:

Try this --
TRANSFORM Count([SAMPLE Install Schedule Table Data].[Project Status]) AS
[CountOfProject Status]
SELECT [SAMPLE Install Schedule Table Data].[Business Unit], Count([SAMPLE
Install Schedule Table Data].[Project Status]) AS [Total Of Project ID]
FROM [SAMPLE Install Schedule Table Data]
GROUP BY [SAMPLE Install Schedule Table Data].[Business Unit]
PIVOT [SAMPLE Install Schedule Table Data].[Project Status];

--
KARL DEWEY
Build a little - Test a little


:

You have been very helpful. I am sorry for not responding sooner. You were
right, the names did not match. I have corrected that and here is the query
in SQL as you requested:

SELECT [SAMPLE Install Schedule Table Data].[Project ID], [SAMPLE Install
Schedule Table Data].[Project Name], [SAMPLE Install Schedule Table
Data].[Business Unit], [SAMPLE Install Schedule Table Data].[Project Status],
[SAMPLE Install Schedule Table Data].[Percent Complete]
FROM [SAMPLE Install Schedule Table Data];

Here is the main table with sample data:
Project ID Project Name Business Unit Project Status Percent
Complete
CP-07-0001-A Site Project 1 Dept.1 Requested
FP-07-0001-A Site Project 2 Dept.3 RFP
CP-07-0002-A Site Project 3 Dept.1 RFP
SC-07-0001-A Site Project 4 Dept.4 Assessment
SC-07-0002-A Site Project 5 Dept.4 Completed
FP-07-0002-A Site Project 6 Dept.3 Execution
FP-07-0003-A Site Project 7 Dept.3 Completed
SC-07-0003-A Site Project 8 Dept.4 Completed
FP-07-0004-A Site Project 9 Dept.3 RFP
CP-07-0003-A Site Project 10 Dept.1 Requested
CP-07-0004-A Site Project 11 Dept.1 Requested
SC-07-0004-A Site Project 12 Dept.4 Requested
SC-07-0005-A Site Project 13 Dept.4 Pending
CP-07-0005-A Site Project 14 Dept.2 Execution
SC-07-0006-A Site Project 15 Dept.4 RFP

Below is the table for the Business Unit combo box on the form:
Business Unit

Dept.1
Dept.2
Dept.3
Dept.4

Below is the table for the Project Status combo box on the form:
Phase

Requested
Assessment
RFP
Pending
Execution
Completed


:

I do not understand the query uou posted. How is Company to equal Priority?
Your orginal post has departments, not companies.
Post the table sturcture with field names and datatype.
Post sample data from each table.
--
KARL DEWEY
Build a little - Test a little


:

SELECT Company.Company, Status.Priority
FROM Company INNER JOIN Status ON Company.Company = Status.Priority;

:

Ok, first create a select query that outputs all the fields you have shown --
Dept, Activity, etc.
Open the query in design view, click on menu VIEW - SQL View, highlight all,
copy, and paste in a post.
--
KARL DEWEY
Build a little - Test a little


:

Could you walk me through this?

:

Post the SQL of your crosstab.
--
KARL DEWEY
Build a little - Test a little


:

Sorry, that wasn't easy to read. Let me try it again...

Req Asmt RFP Exe Comp Totals
Dept.1 6 3 3 5 8 25
Dept.2 1 1 4 6
Dept.3 2 4 6 12 24
Totals 9 4 7 11 24 110



:

Your knowledge and help would be very appreciated.
I have a db to keep track of projects and their status towards completion.
I need to create a summary report that that shows the number of projects for
each department and the number of these same projects and what
phase(Requested, Assessment, RFP...). So the the total number of projects
can be displayed so that you can quickly see the number of projects for each
department for each phase. It would look somthing like this:
Requested Assessment RFP Execution Completed
Totals
Dept.1 6 3 3 5
8 25
Dept.2 1 1
4 6
Dept.3 2 4 6
12 24
Totals 9 4 7 11
24 110

The top row and side columns are 2 Combo Boxes on the project db Form. The
project phases would be across the top and who the project is for would be
listed on the left side. So if a project on the Form has "Dept.2" selected
in one Combo Box and "Assessment" selected on the other Combo Box, the
Crosstab Query would show it. Likewise, if Dept.2's project in the Requested
phase was moved to the Assessment phase, Dept.2's Requested number field
would be empty and it's Assessment Field would show a total of 2.

My problem is that I can't get the Departments to list as rows along the
left side of the Crosstab Query. Am I not using the crosstab correctly?
Should I be going about this diffently? You are dealing with someone who has
a basic understanding of access but is eager to learn.

Once this is done I would like to set up hyperlinks for each field total to
allow you to drill down to more reports for greater details if needed.
 
N

Nathan Lars

I am probably not using the right term.

A table named [Status] is only the list of items shown below with [Phase]
being the column header. One of the combo boxes on the form, named [Project
Status] has the Row Source as [Status], and it's Control Source as [Project
Status].

Another table named [SAMPLE Business Unit Table Data] is set up in the same
way with a list of items (Dept.1, Dept.2, Dept.3, Dept.4) with [Business
Unit] as the column header. The other combo box on the form, named [Business
Unit] has the row source as [SAMPLE Business Unit Table Data] and the control
source as [Business Unit].

What I am trying to do is somehow use the selections from both combo boxes
on the form to sort the records on the main table. This is what I was trying
to describe in my 2nd post. This crosstab "table" with those counts does not
exist but is what I am trying to create. Is that part of my problem? Do I
need to create another table that the crosstab query can store its results in?

If I am not communicating this clearly by text, would a phone conversation
be possible? My number is 512-434-2525.

KARL DEWEY said:
by selecting one of the Phases in the [Status] table which only has 6
fields in that one column.
How can your [Status] table have 6 fields in one column?

--
KARL DEWEY
Build a little - Test a little


Nathan Lars said:
Yes, [SAMPLE Install Schedule Table Data] is the main table and [Project
Status] is one of the columns within that table. [Project Status] is
populated by selecting one of the Phases in the [Status] table which only has
6 fields in that one column. This is one of the two dropdowns on the form.

Sorry if I'm not explaining this clearly.

KARL DEWEY said:
I assume that [SAMPLE Install Schedule Table Data].[Project Status] was the
name of your table based on your posting - query & sample data.

--
KARL DEWEY
Build a little - Test a little


:

I did this and it changed to a crosstab query. Thanks. When I try to run
the crosstab query ti gives this message:
"The Microsoft Jet database engine does not recognize '[SAMPLE Install
Schedule Table Data].[Project Status]' as a valid field name or expression."

What am I missing?


:

Try this --
TRANSFORM Count([SAMPLE Install Schedule Table Data].[Project Status]) AS
[CountOfProject Status]
SELECT [SAMPLE Install Schedule Table Data].[Business Unit], Count([SAMPLE
Install Schedule Table Data].[Project Status]) AS [Total Of Project ID]
FROM [SAMPLE Install Schedule Table Data]
GROUP BY [SAMPLE Install Schedule Table Data].[Business Unit]
PIVOT [SAMPLE Install Schedule Table Data].[Project Status];

--
KARL DEWEY
Build a little - Test a little


:

You have been very helpful. I am sorry for not responding sooner. You were
right, the names did not match. I have corrected that and here is the query
in SQL as you requested:

SELECT [SAMPLE Install Schedule Table Data].[Project ID], [SAMPLE Install
Schedule Table Data].[Project Name], [SAMPLE Install Schedule Table
Data].[Business Unit], [SAMPLE Install Schedule Table Data].[Project Status],
[SAMPLE Install Schedule Table Data].[Percent Complete]
FROM [SAMPLE Install Schedule Table Data];

Here is the main table with sample data:
Project ID Project Name Business Unit Project Status Percent
Complete
CP-07-0001-A Site Project 1 Dept.1 Requested
FP-07-0001-A Site Project 2 Dept.3 RFP
CP-07-0002-A Site Project 3 Dept.1 RFP
SC-07-0001-A Site Project 4 Dept.4 Assessment
SC-07-0002-A Site Project 5 Dept.4 Completed
FP-07-0002-A Site Project 6 Dept.3 Execution
FP-07-0003-A Site Project 7 Dept.3 Completed
SC-07-0003-A Site Project 8 Dept.4 Completed
FP-07-0004-A Site Project 9 Dept.3 RFP
CP-07-0003-A Site Project 10 Dept.1 Requested
CP-07-0004-A Site Project 11 Dept.1 Requested
SC-07-0004-A Site Project 12 Dept.4 Requested
SC-07-0005-A Site Project 13 Dept.4 Pending
CP-07-0005-A Site Project 14 Dept.2 Execution
SC-07-0006-A Site Project 15 Dept.4 RFP

Below is the table for the Business Unit combo box on the form:
Business Unit

Dept.1
Dept.2
Dept.3
Dept.4

Below is the table for the Project Status combo box on the form:
Phase

Requested
Assessment
RFP
Pending
Execution
Completed


:

I do not understand the query uou posted. How is Company to equal Priority?
Your orginal post has departments, not companies.
Post the table sturcture with field names and datatype.
Post sample data from each table.
--
KARL DEWEY
Build a little - Test a little


:

SELECT Company.Company, Status.Priority
FROM Company INNER JOIN Status ON Company.Company = Status.Priority;

:

Ok, first create a select query that outputs all the fields you have shown --
Dept, Activity, etc.
Open the query in design view, click on menu VIEW - SQL View, highlight all,
copy, and paste in a post.
--
KARL DEWEY
Build a little - Test a little


:

Could you walk me through this?

:

Post the SQL of your crosstab.
--
KARL DEWEY
Build a little - Test a little


:

Sorry, that wasn't easy to read. Let me try it again...

Req Asmt RFP Exe Comp Totals
Dept.1 6 3 3 5 8 25
Dept.2 1 1 4 6
Dept.3 2 4 6 12 24
Totals 9 4 7 11 24 110



:

Your knowledge and help would be very appreciated.
I have a db to keep track of projects and their status towards completion.
I need to create a summary report that that shows the number of projects for
each department and the number of these same projects and what
phase(Requested, Assessment, RFP...). So the the total number of projects
can be displayed so that you can quickly see the number of projects for each
department for each phase. It would look somthing like this:
Requested Assessment RFP Execution Completed
Totals
Dept.1 6 3 3 5
8 25
Dept.2 1 1
4 6
Dept.3 2 4 6
12 24
Totals 9 4 7 11
24 110

The top row and side columns are 2 Combo Boxes on the project db Form. The
project phases would be across the top and who the project is for would be
listed on the left side. So if a project on the Form has "Dept.2" selected
in one Combo Box and "Assessment" selected on the other Combo Box, the
Crosstab Query would show it. Likewise, if Dept.2's project in the Requested
phase was moved to the Assessment phase, Dept.2's Requested number field
would be empty and it's Assessment Field would show a total of 2.

My problem is that I can't get the Departments to list as rows along the
left side of the Crosstab Query. Am I not using the crosstab correctly?
Should I be going about this diffently? You are dealing with someone who has
a basic understanding of access but is eager to learn.

Once this is done I would like to set up hyperlinks for each field total to
allow you to drill down to more reports for greater details if needed.
 
K

KARL DEWEY

I now see where you went wrong.

The combo box on the form, named [Project Status] has the Row Source as
[Status].[Phase]. That is where it get the data to display for selection.
It's Control Source will be the field of your data table where that selection
is stored.

The same for the other combo. The Row Source will be [SAMPLE Business Unit
Table Data].[Business Unit].

You have two table that contain pre-loaded information to select from.
Another table contains the project phase records. The crosstab query would
pull data from the project phase table.
--
KARL DEWEY
Build a little - Test a little


Nathan Lars said:
I am probably not using the right term.

A table named [Status] is only the list of items shown below with [Phase]
being the column header. One of the combo boxes on the form, named [Project
Status] has the Row Source as [Status], and it's Control Source as [Project
Status].

Another table named [SAMPLE Business Unit Table Data] is set up in the same
way with a list of items (Dept.1, Dept.2, Dept.3, Dept.4) with [Business
Unit] as the column header. The other combo box on the form, named [Business
Unit] has the row source as [SAMPLE Business Unit Table Data] and the control
source as [Business Unit].

What I am trying to do is somehow use the selections from both combo boxes
on the form to sort the records on the main table. This is what I was trying
to describe in my 2nd post. This crosstab "table" with those counts does not
exist but is what I am trying to create. Is that part of my problem? Do I
need to create another table that the crosstab query can store its results in?

If I am not communicating this clearly by text, would a phone conversation
be possible? My number is 512-434-2525.

KARL DEWEY said:
by selecting one of the Phases in the [Status] table which only has 6
fields in that one column.
How can your [Status] table have 6 fields in one column?

--
KARL DEWEY
Build a little - Test a little


Nathan Lars said:
Yes, [SAMPLE Install Schedule Table Data] is the main table and [Project
Status] is one of the columns within that table. [Project Status] is
populated by selecting one of the Phases in the [Status] table which only has
6 fields in that one column. This is one of the two dropdowns on the form.

Sorry if I'm not explaining this clearly.

:

I assume that [SAMPLE Install Schedule Table Data].[Project Status] was the
name of your table based on your posting - query & sample data.

--
KARL DEWEY
Build a little - Test a little


:

I did this and it changed to a crosstab query. Thanks. When I try to run
the crosstab query ti gives this message:
"The Microsoft Jet database engine does not recognize '[SAMPLE Install
Schedule Table Data].[Project Status]' as a valid field name or expression."

What am I missing?


:

Try this --
TRANSFORM Count([SAMPLE Install Schedule Table Data].[Project Status]) AS
[CountOfProject Status]
SELECT [SAMPLE Install Schedule Table Data].[Business Unit], Count([SAMPLE
Install Schedule Table Data].[Project Status]) AS [Total Of Project ID]
FROM [SAMPLE Install Schedule Table Data]
GROUP BY [SAMPLE Install Schedule Table Data].[Business Unit]
PIVOT [SAMPLE Install Schedule Table Data].[Project Status];

--
KARL DEWEY
Build a little - Test a little


:

You have been very helpful. I am sorry for not responding sooner. You were
right, the names did not match. I have corrected that and here is the query
in SQL as you requested:

SELECT [SAMPLE Install Schedule Table Data].[Project ID], [SAMPLE Install
Schedule Table Data].[Project Name], [SAMPLE Install Schedule Table
Data].[Business Unit], [SAMPLE Install Schedule Table Data].[Project Status],
[SAMPLE Install Schedule Table Data].[Percent Complete]
FROM [SAMPLE Install Schedule Table Data];

Here is the main table with sample data:
Project ID Project Name Business Unit Project Status Percent
Complete
CP-07-0001-A Site Project 1 Dept.1 Requested
FP-07-0001-A Site Project 2 Dept.3 RFP
CP-07-0002-A Site Project 3 Dept.1 RFP
SC-07-0001-A Site Project 4 Dept.4 Assessment
SC-07-0002-A Site Project 5 Dept.4 Completed
FP-07-0002-A Site Project 6 Dept.3 Execution
FP-07-0003-A Site Project 7 Dept.3 Completed
SC-07-0003-A Site Project 8 Dept.4 Completed
FP-07-0004-A Site Project 9 Dept.3 RFP
CP-07-0003-A Site Project 10 Dept.1 Requested
CP-07-0004-A Site Project 11 Dept.1 Requested
SC-07-0004-A Site Project 12 Dept.4 Requested
SC-07-0005-A Site Project 13 Dept.4 Pending
CP-07-0005-A Site Project 14 Dept.2 Execution
SC-07-0006-A Site Project 15 Dept.4 RFP

Below is the table for the Business Unit combo box on the form:
Business Unit

Dept.1
Dept.2
Dept.3
Dept.4

Below is the table for the Project Status combo box on the form:
Phase

Requested
Assessment
RFP
Pending
Execution
Completed


:

I do not understand the query uou posted. How is Company to equal Priority?
Your orginal post has departments, not companies.
Post the table sturcture with field names and datatype.
Post sample data from each table.
--
KARL DEWEY
Build a little - Test a little


:

SELECT Company.Company, Status.Priority
FROM Company INNER JOIN Status ON Company.Company = Status.Priority;

:

Ok, first create a select query that outputs all the fields you have shown --
Dept, Activity, etc.
Open the query in design view, click on menu VIEW - SQL View, highlight all,
copy, and paste in a post.
--
KARL DEWEY
Build a little - Test a little


:

Could you walk me through this?

:

Post the SQL of your crosstab.
--
KARL DEWEY
Build a little - Test a little


:

Sorry, that wasn't easy to read. Let me try it again...

Req Asmt RFP Exe Comp Totals
Dept.1 6 3 3 5 8 25
Dept.2 1 1 4 6
Dept.3 2 4 6 12 24
Totals 9 4 7 11 24 110



:

Your knowledge and help would be very appreciated.
I have a db to keep track of projects and their status towards completion.
I need to create a summary report that that shows the number of projects for
each department and the number of these same projects and what
phase(Requested, Assessment, RFP...). So the the total number of projects
can be displayed so that you can quickly see the number of projects for each
department for each phase. It would look somthing like this:
Requested Assessment RFP Execution Completed
Totals
Dept.1 6 3 3 5
8 25
Dept.2 1 1
4 6
Dept.3 2 4 6
12 24
Totals 9 4 7 11
24 110

The top row and side columns are 2 Combo Boxes on the project db Form. The
project phases would be across the top and who the project is for would be
listed on the left side. So if a project on the Form has "Dept.2" selected
in one Combo Box and "Assessment" selected on the other Combo Box, the
Crosstab Query would show it. Likewise, if Dept.2's project in the Requested
phase was moved to the Assessment phase, Dept.2's Requested number field
would be empty and it's Assessment Field would show a total of 2.

My problem is that I can't get the Departments to list as rows along the
left side of the Crosstab Query. Am I not using the crosstab correctly?
Should I be going about this diffently? You are dealing with someone who has
a basic understanding of access but is eager to learn.

Once this is done I would like to set up hyperlinks for each field total to
allow you to drill down to more reports for greater details if needed.
 
N

Nathan Lars

Thank you for your time and help.

KARL DEWEY said:
I now see where you went wrong.

The combo box on the form, named [Project Status] has the Row Source as
[Status].[Phase]. That is where it get the data to display for selection.
It's Control Source will be the field of your data table where that selection
is stored.

The same for the other combo. The Row Source will be [SAMPLE Business Unit
Table Data].[Business Unit].

You have two table that contain pre-loaded information to select from.
Another table contains the project phase records. The crosstab query would
pull data from the project phase table.
--
KARL DEWEY
Build a little - Test a little


Nathan Lars said:
I am probably not using the right term.

A table named [Status] is only the list of items shown below with [Phase]
being the column header. One of the combo boxes on the form, named [Project
Status] has the Row Source as [Status], and it's Control Source as [Project
Status].
Phase

Requested
Assessment
RFP
Pending
Execution
Completed

Another table named [SAMPLE Business Unit Table Data] is set up in the same
way with a list of items (Dept.1, Dept.2, Dept.3, Dept.4) with [Business
Unit] as the column header. The other combo box on the form, named [Business
Unit] has the row source as [SAMPLE Business Unit Table Data] and the control
source as [Business Unit].

What I am trying to do is somehow use the selections from both combo boxes
on the form to sort the records on the main table. This is what I was trying
to describe in my 2nd post. This crosstab "table" with those counts does not
exist but is what I am trying to create. Is that part of my problem? Do I
need to create another table that the crosstab query can store its results in?

If I am not communicating this clearly by text, would a phone conversation
be possible? My number is 512-434-2525.

KARL DEWEY said:
by selecting one of the Phases in the [Status] table which only has 6
fields in that one column.
How can your [Status] table have 6 fields in one column?

--
KARL DEWEY
Build a little - Test a little


:

Yes, [SAMPLE Install Schedule Table Data] is the main table and [Project
Status] is one of the columns within that table. [Project Status] is
populated by selecting one of the Phases in the [Status] table which only has
6 fields in that one column. This is one of the two dropdowns on the form.

Sorry if I'm not explaining this clearly.

:

I assume that [SAMPLE Install Schedule Table Data].[Project Status] was the
name of your table based on your posting - query & sample data.

--
KARL DEWEY
Build a little - Test a little


:

I did this and it changed to a crosstab query. Thanks. When I try to run
the crosstab query ti gives this message:
"The Microsoft Jet database engine does not recognize '[SAMPLE Install
Schedule Table Data].[Project Status]' as a valid field name or expression."

What am I missing?


:

Try this --
TRANSFORM Count([SAMPLE Install Schedule Table Data].[Project Status]) AS
[CountOfProject Status]
SELECT [SAMPLE Install Schedule Table Data].[Business Unit], Count([SAMPLE
Install Schedule Table Data].[Project Status]) AS [Total Of Project ID]
FROM [SAMPLE Install Schedule Table Data]
GROUP BY [SAMPLE Install Schedule Table Data].[Business Unit]
PIVOT [SAMPLE Install Schedule Table Data].[Project Status];

--
KARL DEWEY
Build a little - Test a little


:

You have been very helpful. I am sorry for not responding sooner. You were
right, the names did not match. I have corrected that and here is the query
in SQL as you requested:

SELECT [SAMPLE Install Schedule Table Data].[Project ID], [SAMPLE Install
Schedule Table Data].[Project Name], [SAMPLE Install Schedule Table
Data].[Business Unit], [SAMPLE Install Schedule Table Data].[Project Status],
[SAMPLE Install Schedule Table Data].[Percent Complete]
FROM [SAMPLE Install Schedule Table Data];

Here is the main table with sample data:
Project ID Project Name Business Unit Project Status Percent
Complete
CP-07-0001-A Site Project 1 Dept.1 Requested
FP-07-0001-A Site Project 2 Dept.3 RFP
CP-07-0002-A Site Project 3 Dept.1 RFP
SC-07-0001-A Site Project 4 Dept.4 Assessment
SC-07-0002-A Site Project 5 Dept.4 Completed
FP-07-0002-A Site Project 6 Dept.3 Execution
FP-07-0003-A Site Project 7 Dept.3 Completed
SC-07-0003-A Site Project 8 Dept.4 Completed
FP-07-0004-A Site Project 9 Dept.3 RFP
CP-07-0003-A Site Project 10 Dept.1 Requested
CP-07-0004-A Site Project 11 Dept.1 Requested
SC-07-0004-A Site Project 12 Dept.4 Requested
SC-07-0005-A Site Project 13 Dept.4 Pending
CP-07-0005-A Site Project 14 Dept.2 Execution
SC-07-0006-A Site Project 15 Dept.4 RFP

Below is the table for the Business Unit combo box on the form:
Business Unit

Dept.1
Dept.2
Dept.3
Dept.4

Below is the table for the Project Status combo box on the form:
Phase

Requested
Assessment
RFP
Pending
Execution
Completed


:

I do not understand the query uou posted. How is Company to equal Priority?
Your orginal post has departments, not companies.
Post the table sturcture with field names and datatype.
Post sample data from each table.
--
KARL DEWEY
Build a little - Test a little


:

SELECT Company.Company, Status.Priority
FROM Company INNER JOIN Status ON Company.Company = Status.Priority;

:

Ok, first create a select query that outputs all the fields you have shown --
Dept, Activity, etc.
Open the query in design view, click on menu VIEW - SQL View, highlight all,
copy, and paste in a post.
--
KARL DEWEY
Build a little - Test a little


:

Could you walk me through this?

:

Post the SQL of your crosstab.
--
KARL DEWEY
Build a little - Test a little


:

Sorry, that wasn't easy to read. Let me try it again...

Req Asmt RFP Exe Comp Totals
Dept.1 6 3 3 5 8 25
Dept.2 1 1 4 6
Dept.3 2 4 6 12 24
Totals 9 4 7 11 24 110



:

Your knowledge and help would be very appreciated.
I have a db to keep track of projects and their status towards completion.
I need to create a summary report that that shows the number of projects for
each department and the number of these same projects and what
phase(Requested, Assessment, RFP...). So the the total number of projects
can be displayed so that you can quickly see the number of projects for each
department for each phase. It would look somthing like this:
Requested Assessment RFP Execution Completed
Totals
Dept.1 6 3 3 5
8 25
Dept.2 1 1
4 6
Dept.3 2 4 6
12 24
Totals 9 4 7 11
24 110

The top row and side columns are 2 Combo Boxes on the project db Form. The
project phases would be across the top and who the project is for would be
listed on the left side. So if a project on the Form has "Dept.2" selected
in one Combo Box and "Assessment" selected on the other Combo Box, the
Crosstab Query would show it. Likewise, if Dept.2's project in the Requested
phase was moved to the Assessment phase, Dept.2's Requested number field
would be empty and it's Assessment Field would show a total of 2.

My problem is that I can't get the Departments to list as rows along the
left side of the Crosstab Query. Am I not using the crosstab correctly?
Should I be going about this diffently? You are dealing with someone who has
a basic understanding of access but is eager to learn.

Once this is done I would like to set up hyperlinks for each field total to
allow you to drill down to more reports for greater details if needed.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top