Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Ken Murphy
  Where is Ken Murphy?
 Springhill
 Canada
 Ken Murphy
 To: Khurram Tahir
  Where is Khurram Tahir?
 Karachi
 Pakistan
 Khurram Tahir
 Tags
Subject: RE: Change of ORDER in Sql Query
Thread ID: 104500 Message ID: 104535 # Views: 2 # Ratings: 0
Version: Visual FoxPro 9 Category: Databases, Tables and SQL Server
Date: Thursday, August 17, 2006 12:37:55 PM         
   


> HDRFN6D="Salgh."
>
> SELE &HDRFN6D.prnt,invoice_no,subs(mrdminv_no,5,6)+subs(mrdminv_no,1,4) as mrdminv_no,;
> &HDRFN6D.date,accbal2.accna,amtgrs,disc,expmnininv,amtnet,citmno,invtype,&HDRFN6D.acccd,;
> trcna,btyno,crtn,bndl,dsptchdby,&HDRFN6D.clkdate,ccna,ccrno,ccrdt,tnr,inat,usrno__,;
> subs(mrdminv_no,1,4)+str(val(subs(mrdminv_no,5,6))) as mrdmno_val,;
> subs(&HDRFN6D.acccd,6,3)+accbal2.accna AS code_alpha_name,;
> o_chgs,&HDRFN6D.dscptg,btydt,btyexp,prtclar;
> FROM FORCE &HDRFN6 ;
> LEFT JOIN ACCBAL2 ;
> ON &HDRFN6D.ACCCD = ACCBAL2.ACCCD ;
> WHERE NOT DELETED() ;
> ORDER BY INVOICE_NO,ACCBAL2.ACCNA,&HDRFN6D.DATE INTO CURSOR tc_hdr_vw_prp READWRITE
>
> How can I change the order of my query among orders i have given in query in order by clause e.g. INVOICE_NO,ACCBAL2.ACCNA,&HDRFN6D.DATE
>
> For a table the syntax is [set order to tagname]


Khurram,

There is absolutely nothing wrong with
SELECT MySelectResultCursor
INDEX ON STR(INVOICE_NO)+STR(ACCNA)+DTOC(DATE,1) TAG MyNewOrder

I do this all the time with grid cursors - I let the user sort the grid by clicking on a column header.

Ken
You shall know the truth - and the truth shall set you free. (John 8:33)

ENTIRE THREAD

Change of ORDER in Sql Query Posted by Khurram Tahir @ 8/17/2006 8:22:59 AM
RE: Change of ORDER in Sql Query Posted by tushar @ 8/17/2006 8:42:42 AM
RE: Change of ORDER in Sql Query Posted by Khurram Tahir @ 8/17/2006 11:41:30 AM
RE: Change of ORDER in Sql Query Posted by tushar @ 8/17/2006 5:49:20 PM
RE: Change of ORDER in Sql Query Posted by Ken Murphy @ 8/17/2006 12:37:55 PM