Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: tushar Kanvinde
  Where is tushar Kanvinde?
 Kolhapur, Maharastra
 India
 tushar Kanvinde
 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: 104567 # Views: 1 # Ratings: 0
Version: Visual FoxPro 9 Category: Databases, Tables and SQL Server
Date: Thursday, August 17, 2006 5:49:20 PM         
   


or you can index it after getting the result
index on invoice_no tag invoice_no
index on accna tag accna
index on date tag date
and then set order to


> > queries do not return with indexes, they return sorted records
> > ORDER BY INVOICE_NO,ACCBAL2.ACCNA,&HDRFN6D.DATE
> > does not give you three different orders/indexes. it sorts on invoice number+accna+date. you can
> > a) give 3 queries for 3 different orders
> > b) index the result after you get it
> > depending on wether u want the client or the server to do the job and the number of records you are expecting in the query
> > > 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]

>
> It means that i have to run query again and again if i want to change the order of cursor


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