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 / Queries / July 2006

Tip: Looking for answers? Try searching our database.

2 crosstabs

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
geebee - 10 Jul 2006 22:43 GMT
hi,

I have the following 2 queries:

calls_by_status:
TRANSFORM Sum(tbl_CACS_activity_by_resolvedstatusandcontactcode.[COUNT( *
)]) AS [SumOfCOUNT( * )]
SELECT tbl_CACS_activity_by_resolvedstatusandcontactcode.ResolvedStatus
FROM tbl_CACS_activity_by_resolvedstatusandcontactcode
GROUP BY tbl_CACS_activity_by_resolvedstatusandcontactcode.ResolvedStatus
PIVOT tbl_CACS_activity_by_resolvedstatusandcontactcode.ResolvedDt;

calls_by_status_and_code:
TRANSFORM Sum(tbl_CACS_activity_by_resolvedstatusandcontactcode.[COUNT( *
)]) AS [SumOfCOUNT( * )]
SELECT tbl_CACS_activity_by_resolvedstatusandcontactcode.ResolvedStatus,
tbl_CACS_activity_by_resolvedstatusandcontactcode.[party code],
tbl_CACS_activity_by_resolvedstatusandcontactcode.[activity cd]
FROM tbl_CACS_activity_by_resolvedstatusandcontactcode
GROUP BY tbl_CACS_activity_by_resolvedstatusandcontactcode.ResolvedStatus,
tbl_CACS_activity_by_resolvedstatusandcontactcode.[party code],
tbl_CACS_activity_by_resolvedstatusandcontactcode.[activity cd]
PIVOT tbl_CACS_activity_by_resolvedstatusandcontactcode.ResolvedDt;

I have no problem using one query as the source for a line graph.  The
problems comes when I want to combine both queries into one line graph.  I
have seen a post suggesting the following SQL, but I cant seem to make any
sense of it to generate my own SQL:

TRANSFORM Sum(IIf([FldName]="Quantity",[Quantity],[Quantity]*[Order
Details]![UnitPrice])) AS DaVal
SELECT Products.ProductName
FROM tblXtabColumns, Orders INNER JOIN (Products INNER JOIN [Order Details]
ON Products.ProductID = [Order Details].ProductID) ON Orders.OrderID =
[Order Details].OrderID
WHERE (((Orders.OrderDate) Between #1/1/1998# And #3/31/1998#))
GROUP BY Products.ProductName
PIVOT [FldName] & Month([OrderDate]);

Does anyone have something I can work with?

Thanks in advance,
geebee
Duane Hookom - 11 Jul 2006 02:45 GMT
Looks like a solution I posted. I don't think it will work with your two
crosstabs since your Row Headings are not the same.

Signature

Duane Hookom
MS Access MVP

> hi,
>
[quoted text clipped - 40 lines]
> Thanks in advance,
> geebee
 
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.