Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Oliver Cortazar
  Where is Oliver Cortazar?
 San Luis Potosi
 Mexico
 Oliver Cortazar
 To: Tai Nguyen
  Where is Tai Nguyen?
 
 United States
 Tai Nguyen
 Tags
Subject: RE: need help with concatenance queries
Thread ID: 228704 Message ID: 228826 # Views: 1 # Ratings: 0
Version: Visual FoxPro 9 Category: General VFP Topics
Date: Thursday, May 21, 2009 8:16:31 PM         
   


> >
> > Ok, try to put the query inside a
TEXT TO
block. This is a nice feature that VFP has that is not present in .NET
> >
> > Your code would be like this:
> >
> >
> > TEXT TO SUBQUERY1 NOSHOW
> > Select distinct u.uname as username,t.username as initials ;
> > from table1 u, table2 t ;
> > Where t.username=initialVar ;
> > ENDTEXT
> > 
> > TEXT TO SUBQUERY2 NOSHOW
> > union
> > select distinct t1.a as username, t1.user as initials ;
> > from table3 t1;
> > where t1.user = temp[i,3];
> > ENDTEXT
> > 
> > 
> > TEXT TO SUBQUERY3 NOSHOW
> > order username;
> > Into cursor trainingRecords
> > ENDTEXT
> > 
> > cQUERY=SUBQUERY1 + SUBQUERY2 + SUBQUERY3
> > &cQUERY
> > 

>
> *********************************************
> *********************************************
>
> How do I execute cQUERY in the run-time and place the data into a cursor(write code to do that because I need to bind the trainingRecords cursor to the report)? How do I run that cQUERY to store all the data in the TrainingRecords cursor after concatenance them altogether? Thanks.
>
> Tai Nguyen.

the &cQUERY line runs the query and stores the result in the trainingRecords cursor.

ENTIRE THREAD

need help with concatenance queries Posted by Tai Nguyen @ 5/20/2009 11:59:13 PM
RE: need help with concatenance queries Posted by Oliver Cortazar @ 5/21/2009 12:56:11 AM
RE: need help with concatenance queries Posted by Tai Nguyen @ 5/21/2009 3:13:37 AM
RE: need help with concatenance queries Posted by Oliver Cortazar @ 5/21/2009 8:16:31 PM
RE: need help with concatenance queries Posted by Tai Nguyen @ 5/22/2009 2:20:36 AM
RE: need help with concatenance queries Posted by Oliver Cortazar @ 5/22/2009 7:06:07 PM
RE: need help with concatenance queries Posted by Anders Altberg @ 5/22/2009 8:12:11 PM