473,387 Members | 1,548 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Query in Access2007 - Select Query Works, Crosstab Query Doesn't

Hi - I'm new to Access and trying to create a complicated database that records info about system interfaces. I want to create a crosstab query that returns a field from the interface record, if a record exists for two systems.

When I run the query as a "select" query, it works fine and returns the values. When I change the query type to "crosstab", Access no longer returns any values in the query.

Here is my "select" query SQL:
Expand|Select|Wrap|Line Numbers
  1. SELECT Systems.System, CrossJoinWithInterface.sub_name1, Systems_1.System, CrossJoinWithInterface.sub_name2, Last(CrossJoinWithInterface.Type) AS LastOfType
  2. FROM Systems AS Systems_1 INNER JOIN (Systems INNER JOIN CrossJoinWithInterface ON Systems.System_ID = CrossJoinWithInterface.system_id_1) ON Systems_1.System_ID = CrossJoinWithInterface.system_id_2
  3. GROUP BY Systems.System, CrossJoinWithInterface.sub_name1, Systems_1.System, CrossJoinWithInterface.sub_name2
  4. HAVING (((Systems_1.System)="plumbing"));
  5.  
Here is my "Crosstab" query SQL:
Expand|Select|Wrap|Line Numbers
  1. TRANSFORM Last(CrossJoinWithInterface.Type) AS LastOfType
  2. SELECT Systems.System, CrossJoinWithInterface.sub_name1
  3. FROM Systems AS Systems_1 INNER JOIN (Systems INNER JOIN CrossJoinWithInterface ON Systems.System_ID = CrossJoinWithInterface.system_id_1) ON Systems_1.System_ID = CrossJoinWithInterface.system_id_2
  4. WHERE (((Systems_1.System)="plumbing"))
  5. GROUP BY Systems.System, CrossJoinWithInterface.sub_name1, Systems_1.System
  6. PIVOT CrossJoinWithInterface.sub_name2;
  7.  
I would appreciate any help that you can give...thank you!!
Oct 7 '10 #1
1 1706
MMcCarthy
14,534 Expert Mod 8TB
It's almost impossible to say without being able to work with the data. Can you set up a file with the two tables(use dummy data if data is sensitive) and the two queries and then zip up the file and attach it to your next post. I'll check it out.

One thing I did notice was you had Systems_1.System in the group by on the crosstab query but not in the select section.
Oct 8 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

15
by: Richard Hollenbeck | last post by:
I tried to ask this question before on the 14th of January but I never got a reply. I'm still struggling with the problem. I'll try to rephrase the question: I have a crosstab query with rows...
4
by: Judy | last post by:
I'm using Access 2003 and was wondering if it is possible to have a paramater selection within a crosstab query so that I wouldn't need to build a new table. I have a select query that I'm using...
2
by: Claus Haslauer | last post by:
Hi, I want to create a crosstab query that looks like this Date | Elevation 1 | Elevation 2 | ... ______________________________________________________________________ Date 1 | xx.y | xx.y...
2
by: scott.k.fraley | last post by:
....and the SELECT thats trying to pull from said Query doesn't like it one bit! ;) I'm working on this project (in Access 2002) and there is a report who's RecordSource is the following...
14
by: Tina | last post by:
My employer tracks productivity/performance of clinicians (how much they bill) each week, its averages for the month, and the 6 months. These averages are compared to their expected productivity....
6
by: tizmagik | last post by:
I am having a lot of difficulty generating a CrossTab Query based report. I have looked online for several tutorials and whatnot but I have not been able to really find what I'm looking for, nor...
3
by: russellhq | last post by:
Hi, I'm fairly new to access and have a little trouble with a crosstab query I've setup. I have a main form where the user selects a project name and below in a subform, a crosstab query is...
4
by: m.wanstall | last post by:
I have a crosstab query that compiles data for Months of the year. I have a stacked select query on top of that crosstab query that uses the latest 2 months data and exports it to a fixed length...
6
by: keyur1719 | last post by:
Hi, I have a crosstab query which is based on a simple select query. Here is how the query works.. The base query gets it date from employee table and their incentives table for the given...
2
by: Jim Devenish | last post by:
I wish to create a crosstab query as the record source for a report. It needs to count data between selected dates which are entered by the user in a popup window. The following Select query...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.