Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Complex SQL Query
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Complex SQL Query
Divers
Thread ID:
00894945
Message ID:
00894945
Vues:
37
Hi
I have the following situtation:
I have a table called meetings (MEETINGS) holding customer code (CODE), date (DATE) and time (TIME) of meeting.
A user is asked to enter a date range ( FromDate - ToDate ), generally a week. The purpose of the form is to show in a grid the different dates in the column headers and the hours in the first column. The data in the grid will be the customers.
The meetings are generally in the 15 or 30 minutes slots. Sometimes, there can be many meetings at the same time.
What i did is create a temp. cursor to hold the dates, then run the query with this cursor as 'left' table and the MEETINGS table in the right, and i get the desired data. The problem is how to create the time column in the grid, without having to run every single time slot through all the week to see how many meetings for every day. To be more specific, let's assume the following data in the meetings table:
CODE      DATE       TIME
CUST1   15/01/2004   10:00
CUST2   15/01/2004   11:00
CUST3   15/01/2004   11:00
CUST4   15/01/2004   12:00
CUST5   15/01/2004   13:00
CUST6   16/01/2004   10:00
CUST7   16/01/2004   11:00
CUST8   16/01/2004   12:30
I would like, in the grid, to obtain something like:
TIME   15/01/2004    16/01/2004
----   ----------    ----------
10:00     CUST1        CUST6
11:00     CUST2        CUST7
11:00     CUST3          -
12:00     CUST4          -
12:30       -          CUST8
13:00     CUST5          -
Is this achievable, or will i have to suffer?

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