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?
 Ken Murphy
 To: Jagdish Sharma
  Where is Jagdish Sharma?
 Jagdish Sharma
Subject: RE: sql statement
Thread ID: 78470 Message ID: 78491 # Views: 1 # Ratings: 0
Version: Visual FoxPro 6 Category: Databases, Tables and SQL Server
Date: Tuesday, October 04, 2005 1:46:14 PM         

> hi experts
> i have two table 'glmaster' and 'purchdetail'
> fields in glmaster
> ac_id,ac_name,address
> fields in purchdetail
> doc_no,doc_date,ac_id,mill_id,qty,rate,amount
> now i want to create a new table with sql like this
> doc_no,doc_date,Account_name,Mill_name,qty,rate,amount
> how can i get this result thru sql
> please help me.thanks in advance
> jagdish

I assume that you would have a "Mill" table somewhere (Mill_Name does not exist int PurchDetail or GLMaster. Let's say that your Mill table contains at least Mill_ID and Mill_Name.

SELECT DocNo, DocDate, Ac_Name as Account_Name, Mill_Name, Qty, ;
Rate, Amount ;
FROM PurchDetail ;
INNER JOIN GLMaster ON PurchDetail.Ac_ID = GlMaster.Ac_ID,;
INNER JOIN MillTable ON PurchDetail.Mill_ID = MillTable.Mill_ID ;


sql statement Posted by Jagdish Sharma @ 10/4/2005 8:29:20 AM
RE: sql statement Posted by Borislav Borissov @ 10/4/2005 9:00:35 AM
RE: sql statement Posted by Ken Murphy @ 10/4/2005 1:46:14 PM
RE: sql statement Posted by Jagdish Sharma @ 10/4/2005 5:44:38 PM