Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Sql syntax
Message
From
22/11/2006 14:25:47
Mike Yearwood
Toronto, Ontario, Canada
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Environment versions
Visual FoxPro:
VFP 6 SP5
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01171866
Message ID:
01171897
Views:
6
>Hello.
>I have 1 purchase order that creates two jobs Master and Child for each stock code.
>
>Each job uses different resources to create it's output.
>
>What i'm trying to do with this sql sentence is to show the resources needed for each stock in the purchase order, but i don't know how to make the join of the Job2.
>
>Thank you for your time.
>
>select a.SalesOrder, a.MStockCode, a.MStockDes, a.MOrderQty, b.Job,
>(select Job from WipMaster where JobMaestro = b.Job) as Job2,
>c.MStockCode as Insumos,c.MDescription as NombreInsumo, c.MQtyIssued as CantidadInsumo,
>d.MStockCode as Insumos2,d.MDescription as NombreInsumo2,d.MQtyIssued as CantidadInsumo2
>from SorDetail as a
>left join WipMaster as b on a.SalesOrder=b.SalesOrder and a.SalesOrderLine= b.SalesOrderLine
>left join WipJobPost as c on b.Job = c.Job
>
>left join WipJobPost as d on d.Job = Job2 <- HOW DO I TELL: USE THE JOB2 COLUMN
>
>where a.SalesOrder = 155 and Left(c.MStockCode,1) <> 'C' and c.TrnType = 'R'

You query would be much more readable if you used

SorDetail as SD
left join WipMaster as WM
left join WipJobPost as WJP
Previous
Reply
Map
View

Click here to load this message in the networking platform