Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old August 25th, 2006, 09:42 AM
Authorized User
 
Join Date: Mar 2006
Location: , , .
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?

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 03:48 PM.


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