Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
|
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 25th, 2006, 09:42 AM
Authorized User
 
Join Date: Mar 2006
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default Query adn DAP error..please help

I have 2 tables with identical fields that I query from. I created a query to each table and then used a union query to stack the information. I then use that union query to sum up the information based on certain criteria. I then create a crosstab query from the summed query. This all works and give me the correct results. Hoever this is where it gets wierd. I tried to create a DAP from the cross tab and I get an error that says "Cannot add object "query name" because it contains no columns." I have colums set in the crosstab..heres the SQL:

TRANSFORM Sum([HandleTimeByJobTitleAndSkillsetTypeCombinedRanged].[HandleTimeHrs]) AS SumOfHandleTimeHrs
SELECT [HandleTimeByJobTitleAndSkillsetTypeCombinedRanged].[JobTitle]
FROM HandleTimeByJobTitleAndSkillsetTypeCombinedRanged
GROUP BY [HandleTimeByJobTitleAndSkillsetTypeCombinedRanged].[JobTitle]
PIVOT [HandleTimeByJobTitleAndSkillsetTypeCombinedRanged].[Skillset Type] In ("BMW","Credit","CU Always","Debit","DI Branch Services","DI Lending","DI Tier 1","Escalation","Nat City","Paylynx");

SO I checked all the queries that I have attached to this cross tab and in the field listing list on the DAP I noticed that I have column lists all the way up until I take the Union query and sum it up. Heres the SQL for that:

SELECT HandleTimeByJobTitleAndSkillsetTypeRangedUnion.Job Title, HandleTimeByJobTitleAndSkillsetTypeRangedUnion.[Skillset Type], Sum(HandleTimeByJobTitleAndSkillsetTypeRangedUnion .CallsAns) AS CallsAns, Sum(HandleTimeByJobTitleAndSkillsetTypeRangedUnion .HandleTime) AS HandleTime, HandleTimeByJobTitleCombinedRanged.HandleTime AS TtlHandleTime, Sum(HandleTimeByJobTitleAndSkillsetTypeRangedUnion .HandleTimeHrs) AS HandleTimeHrs, [HandleTime]/[TtlHandleTime] AS PctHandleTime
FROM HandleTimeByJobTitleAndSkillsetTypeRangedUnion INNER JOIN HandleTimeByJobTitleCombinedRanged ON HandleTimeByJobTitleAndSkillsetTypeRangedUnion.Job Title = HandleTimeByJobTitleCombinedRanged.JobTitle
GROUP BY HandleTimeByJobTitleAndSkillsetTypeRangedUnion.Job Title, HandleTimeByJobTitleAndSkillsetTypeRangedUnion.[Skillset Type], HandleTimeByJobTitleCombinedRanged.HandleTime;


Now I dont have any idea why it says I dont have columns. Am I just an idiot and forgetting something here?






Similar Threads
Thread Thread Starter Forum Replies Last Post
DAP losing connection.... kalebson Access 4 July 10th, 2006 09:05 AM
DAP->PivotTable-change FieldList captions harmony82 Access 0 July 14th, 2005 02:03 PM
populating data into listbox adn datagrid madhava_ram Flash (all versions) 1 February 25th, 2005 11:46 PM
Syntax error in query. Incomplete query clause. dispickle ADO.NET 3 April 16th, 2004 01:04 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.