Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Combining two tables
Message
 
 
To
27/07/2012 11:25:10
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Network:
Windows 2008 Server
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01549418
Message ID:
01549438
Views:
70
This message has been marked as the solution to the initial question of the thread.
>Here is my unsimplified actual code using your suggestions; T1 is replaced with year1 and I also have to separate out the states and customers that correspond.
>
>
>SELECT NVL(Year1.fcustno,Year2.fcustno) AS custno,;
>  NVL(Year1.fcstate,"") AS state1, NVL(Year2.fcstate,"") AS state2,;
>  NVL(Year1.q1sum,0.00) AS y1q1sum, NVL(Year2.q1sum,0.00) AS y2q1sum;
> FROM ;
>     Year1 ;
>    FULL JOIN Year2 ;
>   ON  Year1.fcustno = Year2.fcustno;
>   AND  Year1.fcstate = Year2.fcstate
>
>
>
>This has the following problems.
>If we did not do business with a customer in year1 it is not showing up in the result even though we did do business in year2

If the JOIN conditions are correct, then all rows will show up correctly.
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform