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 / March 2007

Tip: Looking for answers? Try searching our database.

Report combining data from 3 tables with a crosstab?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Nikki - 29 Mar 2007 16:52 GMT
Ok, so, I'm self-taught in Access so sometimes efficient design with
more complex databases evades me.  I've spent a while searching the
groups and trying to apply different situations to this one, but I
still haven't found a solution.  I did previously ask a question
regarding the first two tables, but of course once I was able to apply
a solution to that, the person I'm doing this for wants something more
complex.  I tried to build on what I did, but all my attempts have
given unexpected results.  I'm missing something.

Anyway, I have 3 tables (from a database I did not create):

tblManager
ManagerID (primary)
Manager
Director

tblEmployees
EmployeeID (primary)
ManagerID (foreign from tblManager)
Status (this field has four options, A,B,C,D)

tblCosts
CostID
EmployeeID(foreign from tblEmployees)
Cost

I need to create a report that looks like this:
Manager         Director          A       B       C      D     Cost
John                Sally              1       0       0       2
$100.00
Jane                Bob               0       1       0       1
$50.00
                         Totals:        1       1       0
3       $150.00

So, I know a crosstab query would need to be created to get the values
from Status as a column header.   I was able to do that.  I also know
how to create a query so that it groups by manager and director and
sums the cost.  What I can't do, is combine the two and create a
report that gives expected results.

Any help is appreciated.
Al Campagna - 29 Mar 2007 17:59 GMT
Nikki,
  You wrote...
> Status (this field has four options, A,B,C,D)
Are those four separate fields with a value like 0 or 1 or 2 in each one?

Or, or one field that can contain an "A" or "B" ... etc

In other words, where do the values 0,1,2 come from?
> Manager         Director          A       B       C      D     Cost
> John                Sally              1       0       0       2      100.00

Please describe in detail...
Signature

hth
Al Campagna . Candia Computer Consulting . Candia, NH USA
Microsoft Access MVP
http://home.comcast.net/~cccsolutions

"Find a job that you love, and you'll never work a day in your life."

<snip>
> Anyway, I have 3 tables (from a database I did not create):
>
[quoted text clipped - 29 lines]
>
> Any help is appreciated.
Nikki - 29 Mar 2007 19:21 GMT
Sorry for not explaining well.

The A, B, C, D are values in a drop down for the Status field.  The
numbers would be counts of how many of each status that manager and
director have.

Let me know if I'm still missing some details.

> Nikki,
>    You wrote...> Status (this field has four options, A,B,C,D)
[quoted text clipped - 53 lines]
>
> - Show quoted text -
Al Campagna - 29 Mar 2007 20:41 GMT
Nikki,
  Try this simpler method... since there are only 4 possible values for Status.  Just a
normal Totals query will do it (no Crosstab)
  Break ou the 4 values manually in the query behind the report, by creating 4 calculated
"bound" controls
CountA : IIf(Status = "A", 1, 0)
CountB : IIf(Status = "B", 1, 0), etc....  for all A,B,C,D   Sum on those fields, by
Director, right in th query.
Then, on the report...

Manager Group --------
   [Manager]
Detail------------
   [Director]     [CountA]   ....etc................ [Cost]
Manager Footer------------
                   =Sum(CountB)                   =Sum(Cost)

Signature

hth
Al Campagna . Candia Computer Consulting . Candia, NH USA
Microsoft Access MVP
http://home.comcast.net/~cccsolutions

"Find a job that you love, and you'll never work a day in your life."

> Sorry for not explaining well.
>
[quoted text clipped - 61 lines]
>>
>> - Show quoted text -
Nikki - 30 Mar 2007 20:39 GMT
Yes!!  That's it!  Thanks so much!

> Nikki,
>    Try this simpler method... since there are only 4 possible values for Status.  Just a
[quoted text clipped - 90 lines]
>
> - Show quoted text -
 
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.