Re: SQL Division



On May 30, 2:07 pm, "Roger Carlson" <RogerCarl...@xxxxxxxxxxxxxxx>
wrote:
my purpose for participating in these newsgroups is to help people solve
problems

And if in the process of trying to help you inadvertently made a
misstatement that provided a distraction from a solution, would you
want to resolve it?

I've a proposal: we collaborate to resolve your point to our mutual
satisfaction, thank each other sincerely for taking the time, then the
one of us with the better 'people skills' and greater 'ownership' of
the OP's problem (which I suggest is you) can give a more direct
answer to the OP. OK?

A reminder of your point:

In Access, the only way you can have a Subquery in the FROM clause is to
surround the subquery with brackets ([]), NOT parenthases. The problem,
however, is that you CANNOT, then have any brackets in your subquery.

Given the example

SELECT *
FROM (
SELECT OrderID, max(UnitPrice)
FROM [Order Details]
GROUP BY OrderID
) AS t;

which features

· a subquery in the FROM clause
· parentheses surrounding the subquery
· brackets and parentheses within the subquery

you later qualified:

Yes, this will work. However if you go to the Design View of the query and
save it, it will revert to the bracketed version...
So the version with parentheses is not stable in Access.

I tested on Access2000 and Access2007. The query executes without
error. The query saves without error. Upon switching between 'design
view' and 'SQL view', saving and reopening and combinations thereof,
the SQL text remains identical.

In case it makes a difference, I used the Access interface to create a
new Query object in 'design view', switched to 'SQL view' at the
earliest opportunity and pasted in the SQL text as posted. In detail,
on the Access2007 ribbon choose 'Create' (menu item), then 'Query
Wizard' (button); on the resulting 'Show Table' dialog and with no
table selected, hit 'Close' (button); on the ribbon, choose 'SQL
View' (button). At this point I can save and reopen, execute or switch
views, in any order, and the SQL text remains identical and
functional, with the subquery remaining in parentheses.

In short, nothing you have said about 'bracketing' is bourn out by my
testing and IMO can be disregarded. Therefore, we are back at, "Try
removing the dot."

Jamie.

--


.


Quantcast