Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Need to combine 3 child records into 1 record
Message
From
17/12/1999 08:30:08
Shane Gilbert
Oklahoma State Department of Education
Norman, Oklahoma, United States
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00304928
Message ID:
00305187
Views:
38
>>Any help would be greatly appreciated.
>
>Can you give an example of of which fields in which tables you need to pull out and how the tables relate to each other? Something like this is always easier to visualize with sample data structures.

Parent Table Name ifsp (ifspid I, targetdate D, completedate D, etc.)
ifspid is primary key

Child Table Name ifsp_svc (svc_id I, ifspid I, svc_type N(2,0), freq N(2,0), startdate D, etc.)
svcid is primary key, ifspid is link to ifsp table

For a given IFSP record, there will be 1 to 3 IFSP_SVC records. I want a SQL SELECT or some other simple way to combine the ifspid field and the svc_type, freq, startdate fields from all three child records into one record. Something like this:

ifspid,svc_type1,freq1,startdate1,svc_type2,freq2,startdate2,svc_type3,freq3,startdate3

I hope this is clearer. I know I can create a temp cursor and scan through the child records and insert the fields in one at a time, but it seems like there should be a better way. Thanks for your help.

Shane
--Shane
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform