Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Convert rows into columns
Message
 
À
07/06/2003 18:00:01
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00797678
Message ID:
00798217
Vues:
39
I need this table for creating documets in word, via mailmerge... Sorry non-spanish-talking people, but i´ll have to write on spanish...

La tabla la necesito para hacer mailmerge con Word, el programa registra las materias que cursan los estudiantes la idea es que se impriman las constancias con las descripciones y calificaciones obtenidas. No he encontrado la forma de hacer que en un solo documento modelo de Word, se puedan incluir varios registros de la tabla de datos que la alimenta, asi que la solucion que se me ocurrio fue crear una tabla final que tuviese "N" columnas para la descripcion de cada materia, cada calificacion, etc, por ejemplo:

Hacemos constar que Jonathan Matinez, portador de la cedula de identidad 999999, curso y aprobo las asignaturas que se indican:

Descripcion Calificacion
Matematicas I 77
Lenguaje y literatura 90
Logica Matematica 80
....
....

La cantidad de asignaturas cursadas no es constante.., lo que hice fue crear tantos cursores como asignaturas curse el estudiante y luego relacionarlos por el numero de la cedula para crear una tabla con una columna por asignatura y calificacion, lo hice ayudandome con macros..

Espero haber sido mas claro escribiendo en mi idioma, aunque eso afecte mi ego de bilingue..

Gracias por tan pronta respuesta.


>>Hi y'all.
>>I need to obtain a cursor with one column for each row corresponding to a code in a master tabla, let me explain further..
>>There is a parent table and a child table, both have a field called "cedula" which i use to join them, the chilt table has another fiel called "curso" which contains the code of an item, what i need is to obtain a cursor with the following structure:
>>
>>cedula,curso1,curso2,curso3,curso4......cursoN
>>
>>I made a program that works with macro substitution and creating N cursors which i join at the end, but i think there must be a better way..
>>
>>Is that possible?? how??
>>
>>Thanks in advance.
>>
>>jonamart@cantv.net
>
>Here are some ideas:
>
>I don't think you can do this in a few commands. However, you could use SQL - SELECT, with a UNION, to combine the tables vertically. The problem is, the individual parts must be "union compatible", meaning they have to have exactly the same fields. Perhaps this is a little bit simpler than your current approach, perhaps it isn't.
>
>For a loop, you can use the field() function to return a field at a specific position. This might be of help, too.
>
>I assume you need this for some kind of report. Perhaps the report is done easier with Excel, using Automation - if this is an option for your system.
>
>Saludos,
>
>Hilmar.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform