Solved

Crosstab query problem

Posted on 2008-10-14
4
215 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
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…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

738 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