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

K

KitKat

(Cross-posted; also on comp.databases.ms-access)

Dear Microsoft.Public.Access,

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
 
S

Steve Schapel

KitKat,
(Cross-posted; also on comp.databases.ms-access)

This is not the meaning of "cross-posted". This is often referred to as
multi-posting. Cross-posted would mean you had addressed a single
message simultaneously to both groups. This would have been preferable
to posting a copy of the message separately to each group.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top