Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
View from Multiple Tables
Message
From
15/01/2004 08:53:56
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
15/01/2004 08:48:31
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00867048
Message ID:
00867058
Views:
23
>>Can someone help me to create a view?
>>
>>I have one table(one side) that holds customer numbers, program description, indicates wheather or not the program is in process, indicates if the program is closed, program manager, hours to complete, and comments. From this table I need to know which programs are in process and not closed.
>>
>>My second table(many side) lists the milestone task that each customer number requires, baseline date to complete, adjusted date to complete, percentage complete.
>>
>>From this table I need two records for each customer number, each task named "Load Common Structures" and "Load Final Structure". Then only records where the "Load Final Structure" is not 100% complete.
>
>Something like this :
>
>select * ;
> from force t1 inner join t2 on t1.custno=t2.custno and ;
>   inlist(t2.task,"Load Common Structures","Load Final Structure") ;
> where
>t1.custNo in ;
>(select custNo from t2 where ;
>Task == "Load Final Structure" and pctComplete < 100)
Once you are satisfied with the results add 'create SQL view viewName as ' in front of select.
>Cetin

This might be a designer friedly version :
select <fieldList> ;
 from t1 ;
   inner join t2 on t1.custno=t2.custno and ;
   t2.task == "Load Common Structures" ;
   inner join t2 t3 on t1.custno=t3.custno and ;
   t3.task == "Load Final Structure" and t3.pctComplete < 100
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