Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Kulwant Singh
  Where is Kulwant Singh?
 Shimla
 India
 Kulwant Singh
 To: M. Akram Bhatti
  Where is M. Akram Bhatti?
 Riyadh
 Saudi Arabia
 M. Akram Bhatti
 Tags
Subject: RE: sql join statement
Thread ID: 228177 Message ID: 228456 # Views: 1 # Ratings: 0
Version: Visual FoxPro 9 Category: Databases, Tables and SQL Server
Date: Tuesday, May 19, 2009 7:04:19 AM         
   


> >
> > Dear Mr. Anders and Mr. Tushar,
> >
> > Thank you for your time.
> >
> > The following is giving me the required result
> >
> >
SELECT acno , sect from FROM CLIST where CLIST.SECT = 'B' INTO TABLE TEMP
> > 
> > SELECT entry.*;
> > FROM entry, narrat ;
> > WHERE entry.vno = narrat.vno AND ;
> > narrat.edate >= DATE(gCURRENTYEAR,03,01) AND ;
> > narrat.edate < THISFORM.TEXT1.VALUE AND ;
> > entry.code_no = 3;
> > INTO CURSOR temp1
> > 
> > 
> > SELECT CLIST.acno, NVL(SUM(temp1.amount),000000) AS RECPT ;
> > FROM CLIST LEFT JOIN temp1 ON CLIST.acno = temp1.acno ;
> > GROUP BY 1 INTO CURSOR RECPTS

> >
> >
> > Can you help combine the last two SQL Statements into ONE?
> >
> > Thanks!
> > kulwant
>
>
SELECT acno , sect from FROM CLIST where CLIST.SECT = 'B' INTO TABLE TEMP
> 
> SELECT CLIST.acno, NVL(SUM(temp1.amount),000000) AS RECPT ;
> FROM CLIST LEFT JOIN (SELECT entry.*;
> FROM entry, narrat ;
> WHERE entry.vno = narrat.vno AND ;
> narrat.edate >= DATE(gCURRENTYEAR,03,01) AND ;
> narrat.edate < THISFORM.TEXT1.VALUE AND ;
> entry.code_no = 3) temp1 ON CLIST.acno = temp1.acno ;
> GROUP BY 1 INTO CURSOR RECPTS
> 
> 

>
> Regards,
> Akram

Thank you Sir!

kulwant

ENTIRE THREAD

sql join statement Posted by kulwant singh @ 5/16/2009 8:34:27 AM
RE: sql join statement Posted by tushar @ 5/16/2009 8:58:51 AM
RE: sql join statement Posted by Anders Altberg @ 5/16/2009 8:38:34 PM
RE: sql join statement Posted by kulwant singh @ 5/18/2009 5:58:01 AM
RE: sql join statement Posted by M. Akram Bhatti @ 5/18/2009 7:24:08 AM
RE: sql join statement Posted by kulwant singh @ 5/19/2009 7:04:19 AM
RE: sql join statement Posted by Anders Altberg @ 5/18/2009 10:15:46 AM
RE: sql join statement Posted by kulwant singh @ 5/19/2009 7:03:24 AM