473,395 Members | 1,608 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,395 software developers and data experts.

Queries with identical SQL code behave differently (one is expandable)

I've got two queries; one is a modification of an older query; the
other I created from scratch.

The old one is about 5 copies down the road from something that has
been expandable when I'm in View mode--it showed the Points of Contact
for records whose Begin Date was in a form-selected (or manually
inputted) year. That used to be all it did. Then copied it, took out
the year criterion, and changed "POC" to show the Director field
instead.

I forgot why my original POC form was expandable to show the records
under that POC's name. I still don't remember. I've looked in the
original query's SQL code, in Relationships, etc. Nothing there, as
far as I can tell! It's a mystery why I get these handy plus signs in
the original and all its Copy-Paste derived queries.

Anyway, recently I copied that Directors "group by" query, added a
"group by POC" and a "count of POC" and an "after today" to the end
date, and it still expands the Directors group when I click on the + at
the left.

When I created the exact same thing in design view (I was taking
screenshots, making a tutorial for my successors) I suddenly realized
it wasn't showing any plusses.

I've got identical SQL in these things, no references to the
"expandable" one in Relationships or any other tables/queries/forms,
and still they behave differently than each other.

Any ideas as to why I can display the records (a subquery, is it?) for
the first-listed Group By field on one query but not the other??
Here's my SQL code for the handmade one:

SELECT tblUltimateMasterTrackingLog.fldSalesDirectorLast,
tblUltimateMasterTrackingLog.fldPOC,
Count(tblUltimateMasterTrackingLog.fldPOC) AS CountOffldPOC
FROM tblUltimateMasterTrackingLog
WHERE (((tblUltimateMasterTrackingLog.fldEndDate)>#1/3/2006#))
GROUP BY tblUltimateMasterTrackingLog.fldSalesDirectorLast,
tblUltimateMasterTrackingLog.fldPOC
ORDER BY tblUltimateMasterTrackingLog.fldSalesDirectorLast,
tblUltimateMasterTrackingLog.fldPOC;
And here's the SQL code for the expandable "copy-paste-change" one:

SELECT tblUltimateMasterTrackingLog.fldSalesDirectorLast,
tblUltimateMasterTrackingLog.fldPOC,
Count(tblUltimateMasterTrackingLog.fldPOC) AS CountOffldPOC
FROM tblUltimateMasterTrackingLog
WHERE (((tblUltimateMasterTrackingLog.fldEndDate)>#1/3/2006#))
GROUP BY tblUltimateMasterTrackingLog.fldSalesDirectorLast,
tblUltimateMasterTrackingLog.fldPOC
ORDER BY tblUltimateMasterTrackingLog.fldSalesDirectorLast,
tblUltimateMasterTrackingLog.fldPOC;

-KitKat

Jan 3 '06 #1
5 2345
Red
I can't wait to get back to an assignment that has Access 2000+....
I've been stuck in access 97 for so long now, I'm having a hard time
remember the sweet little things like expandable queries...
Anyhow, check your relationships.. that may be your problem :D

~Red

Jan 3 '06 #2
It sounds like you have a one-to-many relationship defined. Go to Tools
Relationships. If all you get is a grey screen right-click and choose "Show All". If you have any relationships defined they should show up here.


Jan 3 '06 #3
Whoa, looks like the other half of my post is being read as a quote.
Your relationships can be checked (as Red indicated as well), which can
be done by going to Tools - Relationships. Slightly more info available
if you click on the 'Show quoted text' bit of my last reply. Note that
while I'm too lazy to simply copy 'n' paste those ten or so words here,
I am freely writing two sentences to describe them.

Jan 3 '06 #4
Right. As I said, I already checked in Relationships.
One update, though. It turns out the subqueries expand to show all
records with the same "POC" as the line I expanded, not all records
with the same "Whatever is Grouped By first" as the line I expanded
(which in this case would be "Director").

Jan 3 '06 #5
I'm not stating that I don't think you checked the Relationships
window, but the plus sign you describe and the behavior it exhibits
usually occurs when there is a one-to-many relationship defined for the
table. Is the table underlying your "expandable" query referenced in
the Relationships window? If it's not, use Show Table to add it. Do any
relationships appear now?

Jan 3 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Mike N. | last post by:
Hello: I am new to T-SQL programing, and relativly new to SQL statements in general, although I have a good understanding of database theory. I'm a little confused as to the fundamental...
12
by: MikeT | last post by:
I have a page that produces little thumbnails of the 3D models it finds in a specified directory (and iterates down through any sub directories). It basically scans each directory for 3D Studio...
8
by: alanstew | last post by:
With the body tag calling out 'window onload', a function with a 'window.open' fails at the 'window.open' line. If I cut out the body tag, the function executes as normal. At first I thought it...
8
by: PC Datasheet | last post by:
If a subroutine runs twelve action queries, will they run one-at-a-time where one finishes before the next one starts or will one or more run simultaneously? If they don't run one-at-a-time, how...
289
by: napi | last post by:
I think you would agree with me that a C compiler that directly produces Java Byte Code to be run on any JVM is something that is missing to software programmers so far. With such a tool one could...
16
by: Joe Fallon | last post by:
I have a C# class that works correctly. I translated it to VB and now it runs differently. The C# class evaluates the Public properties and then executes MyBase.New. So default values are set...
1
by: loosecannon_1 | last post by:
Hello everyone, I am hoping someone can help me with this problem. I will say up front that I am not a SQL Server DBA, I am a developer. I have an application that sends about 25 simultaneous...
3
by: mikes | last post by:
I have 2 separate queries, which effectively are the same except they draw data from separate tables. Both tables are (design-wise) identical, only the data is different. for each query, there are...
3
by: Ian Roddis | last post by:
Hello, I want to embed SQL type queries within an XML data record. The XML looks something like this: <DISPLAYPAGE> <FIELD NAME="SERVER" TYPE="DROPDOWN"> <OPTION>1<OPTION> <OPTION>2<OPTION>...
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: 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...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.