Re: View Design problem

Tech-Archive recommends: Speed Up your PC by fixing your registry



Zeepowlee wrote:
"Jack Jackson" <jacknospam@xxxxxxxxxxxxxxx> wrote in message news:cqkt329kroaeddeler84ipqbm84pt81lo2@xxxxxxxxxx

On Thu, 13 Apr 2006 15:35:21 -0400, "Zeepowlee" <nospam@xxxxxxxxxx>
wrote:


I have a View, defined as follows:

SELECT inv.barcode, MAX(Item.modello) AS maxmod,;
MAX(Item.colore), MAX(Item.taglia), COUNT(Item.taglia) AS pieces;

FROM mydatabase!inv INNER JOIN mydatabase!ITEM ;

ON inv.barcode = Item.barcode;
GROUP BY inv.barcode;
ORDER BY 2

This last '2' is the problem.
I want the resulting view to be ordered by maxmod. If I copy & paste this
query into the command window, with maxmod instead of '2', it works fine:
rows are ordered by maxmod.
The problem is, if I open the view SQL, I change the 2 into maxmod or even
MAX(Item.modello),
once I save and reopen the definition..... VFP has changed maxmod into 2
again!!!

Why?

I don't know, but why do you care? It should work the same either
way.



Thank you and also Cy,
but it doesn't work the same at all....

Resulting rows are just grouped by barcode, and not ordered by maxmod.

Strange, according to the help file the 2 in the order should be the same thing. Using the number in place of a field name is supposed to use use the field in that position of the select statement.


--
Cy Welch
Senior Programmer
MetSYS Inc
http://www.metsysinc.com
.



Relevant Pages

  • Re: View Design problem
    ... Cindy Winegarden MCSD, Microsoft Visual FoxPro MVP ... I want the resulting view to be ordered by maxmod. ... VFP has changed maxmod into 2 ...
    (microsoft.public.fox.helpwanted)
  • Re: View Design problem
    ... I want the resulting view to be ordered by maxmod. ... VFP has changed maxmod into 2 again!!! ... My guess it that it is easier for VFP to figure it out when it runs the query since maxmod is the 2nd field so the 2 in ORDER BY is the same thing as maxmod. ...
    (microsoft.public.fox.helpwanted)
  • Re: View Design problem
    ... FROM mydatabase!inv INNER JOIN mydatabase!ITEM; ... I want the resulting view to be ordered by maxmod. ... VFP has changed maxmod into 2 ... but why do you care? ...
    (microsoft.public.fox.helpwanted)
  • Re: View Design problem
    ... FROM mydatabase!inv INNER JOIN mydatabase!ITEM; ... I want the resulting view to be ordered by maxmod. ... VFP has changed maxmod into 2 ... but why do you care? ...
    (microsoft.public.fox.helpwanted)
  • View Design problem
    ... FROM mydatabase!inv INNER JOIN mydatabase!ITEM; ... I want the resulting view to be ordered by maxmod. ... VFP has changed maxmod into 2 ...
    (microsoft.public.fox.helpwanted)