Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Table from Vertical to horizontal
Message
 
 
À
10/12/2008 03:55:22
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 9 SP2
Divers
Thread ID:
01365804
Message ID:
01366413
Vues:
11
>Dear Naomi,
>The coding is now working properly and successfully, however I just want to share with you the following information and what exactly was wrong in the coding and how I fix it. maybe it is not the right solution but it is working perfectly.
>the first part of the code you sent me was working properly, but the second one was working only for the first subject and then was not making the loop to create the other subject this is why at a certain time the error comes with variable not found. here I create a table using sql create table with only two field studentid and name after that I alter the table based on cursor c_uniquesubjects then I used the first line of the second part to be able to enter all students scan
>
>if not seek(id_a, 'FinalTEST')
> insert into FINALTEST(ID_a, FIRSTName) values (Report.ID_a, Report.Name)
>ENDIF
>ENDSCAN
>
>Finaly I and sql query based on two tables the original one "report" and the table created through the code after that
>I made just the replacement using the following:
>
>SELECT C_UNIQUESUBJECTS
>SET ORDER TO lfsubj && SUBJECT
>GO TOP
>SCAN
>SELECT C_UNIQUESUBJECTS
>LSUBJECT=ALLTRIM(SUBJECT)
>SELECT FINALRESULT
>REPLACE ALL &LSUBJECT WITH ALLTRIM(MARK) FOR SUBJECT="&LSUBJECT"
>ENDSCAN
>
>Maybe is little bit long but it is working without errors and I checked that all information are placed in the right fields.
>Thank you so much Naomi and best regards

Honestly I don't understand this code now and I believe the code I posted originally from the top of my head should have worked (even if I never tried it), but as long as the new code works for you, I guess, it's all that matters.
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform