Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Facing Problem in Left Outer Join condition
Message
From
25/10/2005 04:10:07
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
25/10/2005 03:53:37
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows 2000 SP4
Network:
Windows 2000 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01061767
Message ID:
01061770
Views:
16
>Dear Experts,
>
>I have header table and detailed table, i want to retrive all the data from header table
>+ and the data from datailed table in which heder id = detailed id.
>
>The purpose of this report to print the stock aging of items.
>Once this items using for transacitn it will come to detailed table.
>And which are not using will still remain in the Header file.
>For calculating aging i want all the data from Header and Transaction
>
>A-> Header table
>B-> Detailed table
>
>select A.code, A.Desc, B.Cost, B.Qty from A
>Left Outer join B on A.Code = B.Code And substring(B.Voucher,1,3)= 'ABC'
>
>this is retriving all the datas which are commen in both tables,
>but i want retrive all the data same as above + some items are in eader table
>which are not participate in transactions(These items are can not find in detailed file).
>
>Or, for Example
>
>Header Table -> 10 rows
>Deatled Table -> 6 rows
>
>Resulted table should contain 16 rows with contions as above
>
>Tahnks in advance
>Regards
>Abdulla

A and B are workarea aliases. Use tablenames instead in from part. ie:
select A.code, A.Desc, B.Cost, B.Qty ;
   from headerTable A ;
   Left join detailTable B ;
     on A.Code = B.Code And ;
        substr(B.Voucher,1,3)= 'ABC'
You say header id - > detail id. If field names are not code than adjust that. Using A, B ... J,M as tablename is always open to errors.

Is 'substrinb' is a typo or a user defined function?
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform