Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
2 tables at mygrid
Message
De
23/08/2005 13:00:59
 
 
À
23/08/2005 12:46:38
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Versions des environnements
Visual FoxPro:
VFP 8
Database:
Visual FoxPro
Divers
Thread ID:
01042845
Message ID:
01042993
Vues:
16
M.

YOU know the names of your fields, especially Course number. I don't know what you called them. My SQL was a guide for you. It's uop to you to substitute the correct field names. I would have thought that the course number would have been your PK, rayther than the "no" field you've added to both tables.

Indeed, IS your main course table actually called "Course" or is it just "Table1"? If so, THAT's the problem.

>hi,
>ok
>i add FIELD(NO)numaric typ, at the 2 tables to make link,
>one as PK ,another is FK,
>i get error message just syntax error
>via suspend the cursore stop at the first line ---> select course.coursenumb
>
>Select course.coursenumb, course.coursename, ;
>       table2.g1, table2.g2, table2.wm1, table2.g3, table2.tot1, ;
>       table2.chr1, table2.g4, table2.g5, table2.wm1, table2.g6, table2.tot2, table2.ltot, table2.chr2 ;
>  from Course ;
>  inner join on table2.no = course.no ;
>  into cursor csrCourseStats
>
>Thisform.Grid1.RecordSource = "csrCourseStats"
>
>
>
>
>
>>As I said, "I'm presuming the second table contains some statistics about the courses and is therefore linked to it by some key, which you haven't detailed."
>>
>>Of course the code as it is will be wrong, as I didn't know your key fields, so invented dummy ones: table2.courseFK = course.coursePK. It was up to you to supply that.
>>
>>Also, as usual, you haven't said what the syntax error is.
>>
>>If you have no keys linking the tables then I don't know HOW you'd get the display you want. :-)
>>
>>>hi,
>>>thank you for reply,
>>>i create 2 tables
>>>first table course with 2 fields only coursenumb and coursename
>>>second table table2 with all fields g1,g2,wm1,g3,tot1,chr1,g4,g5,wm1,g6,tot2,ltot,chr2
>>>
>>>
>>>i try code as it is, at myform inti event
>>>i get error message syntax error
>>>
>>>thanks
>>>
>>>>Hi M
>>>>
>>>>I'm presuming the second table contains some statistics about the courses and is therefore linked to it by some key, which you haven't detailed. If this is the case then you want a query/view that brings the two together in a cursor, then programmatically set the cursor to be the recordSource of your grid. e.g. something like:
>>>>
>>>>
>>>>Select course.coursenumber, course.coursename, ;
>>>>       table2.g1, table2.g2, table2.wm1, table2.g3, table2.tot1, ;
>>>>       table2.chr1, table2.g4, table2.g5, table2.wm1, table2.g6, table2.tot2, table2.ltot, table2.chr2 ;
>>>>  from Course ;
>>>>  inner join on table2.courseFK = course.coursePK ;
>>>>  into cursor csrCourseStats
>>>>
>>>>Thisform.myGrid1.RecordSource = "csrCourseStats"
>>>>
>>>>
>>>>HTH
>>>>
>>>>Terry
>>>>
>>>>>hi all,
>>>>>would you help me,
>>>>>
>>>>>i want to get fields form 2 tables to mygrid as under
>>>>>table1 have course number,course name
>>>>>table 2 have g1,g2,wm1,g3,tot1,chr1,g4,g5,wm1,g6,tot2,ltot,chr2
>>>>>
>>>>>i need to see at mygrid1 course name from table1
>>>>>and g1,g2,wm1,g3,tot1,chr1,g4,g5,wm1,g6,tot2,ltot,chr2
>>>>>from table2
>>>>>
>>>>>and i need to save(append) at table2 COURSE NUMBER from table1
>>>>>and all records have g1,g2,wm1,g3,tot1,chr1,g4,g5,wm1,g6,tot2,ltot,chr2
>>>>>
>>>>>course name  g1   g2  wm1  g3  tot1  chr1 g4 g5 wm1 g6 tot2 ltot chr2
>>>>>  math       14.5 12  7    40   73.5  ..............................
>>>>>  since .............................................................
>>>>>   .
>>>>>   .
>>>>>   .
>>>>>   .
>>>>>   .
>>>>>
>>>>>
>>>>>thanks.
>>>>>m.qasem
- Whoever said that women are the weaker sex never tried to wrest the bedclothes off one in the middle of the night
- Worry is the interest you pay, in advance, for a loan that you may never need to take out.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform