Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Help with SQL Select clause...
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Help with SQL Select clause...
Versions des environnements
Visual FoxPro:
VFP 9 SP1
Database:
Visual FoxPro
Divers
Thread ID:
01181103
Message ID:
01181103
Vues:
59
Fabio did help me once with something similar, but i can't seem to grab the logic in doing what i need here using pure SQL-SELECT statements...

I have the following tables:
1) Table Employees: EmpID (I) PK, EmpName C(30)
2) Table Sched: SchedID(I) PK, EmpID(I), SchedTime (DT), Flight C(10)
In sched, i can have many flights for the same employee in the same day, or just one flight in a specific date.
I would like to crosstab the dates for a week to have the whole week in the header. For each cell in the generated matrix, i'd like to see the flight and the time ( just the time part of the datetime field, i.e ttoc(schedtime,2) )
I try to build the following result:
Employee    Monday 1/1     Tuesday 2/1    Wednesday 3/1  Thurs 4/1 ...
---------------------------------------------------------------------
Jaime       BA123 10:00     BA123 10:00     BA123 10:30   LY111 16:30 
            LY111 16:30                     LY111 16:30   
I did this through a manual loop through the table, but i'd like to do it through SQL if possible, so any ideas will be greatly appreciated.

In the meantime, a happy and productive new year to all
Jaime
Why do programs stop working correctly as soon as you leave the Fox?
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform