Solved

Crosstab query problem

Posted on 2008-10-14
4
210 Views
Last Modified: 2013-11-29
I get an error when I try to open a report which is based on a crosstab query.  The error is due a missing field the crosstab after it is run on a certian set of data.  The report has fixed fields which display the count of records which contain a certain value in a table.  Is there some way that I can make the crosstab query display certain value feilds even if the table/query that the data comes from is not present.  Also I have tried IIF statements in the report to ignore the missing feild and display 0 but this did not work.  

Any ideas?  

The report works fine if the feild is present in the crosstab query.

0
Comment
Question by:randyone
  • 2
4 Comments
 
LVL 77

Expert Comment

by:peter57r
ID: 22718343
You can set fixed field names in the Columns property of the query - you must match exactly the spelling in the data.
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 22719752
randyone,


Try Pete's suggestion first.


Some common things you can try, depednding on how your data is structured.

- Do not use fixed Fields in the report, simply insert the crosstab query as a sub report.
- Create a table with all of the fields and use a Join to display all the fields (even if they are missing)

JeffCoachman
0
 

Accepted Solution

by:
randyone earned 0 total points
ID: 22725353
Thanks guys for the suggestions, but I after digging that that I can add a IN option after the PIVOT statement in SQL which fixes the feilds.  I ended up with something like this:

PIVOT queNetRecordsAll.block_code In(0,4,5);

Worked perfectly!

Thanks again,

Randy
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 22727075
Congratulations!
;-)
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Introduction When developing Access applications, often we need to know whether an object exists.  This article presents a quick and reliable routine to determine if an object exists without that object being opened. If you wanted to inspect/ite…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now