Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Select Statement Help?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00566073
Message ID:
00566087
Vues:
19
You can use Union here. Like:

Select DIST lastname,firstname,isblock,blockslot,schdatedist from Meetings where SCHDATE=(given date);
UNION;
Select dist blocks.lastname, blocks.firstname, isblock, blocks.blockslot, blocks.schdatedist from blocks, meetings where blocks.SCHDATE=(given date) and;
blocks.firstname+blocks.lastname==meetings.firstname+meetings.lastname

The result will not contain records which are in blocks only.
All related fields must have the very same structure (blocks.firstname/meetings.firstname, etc..)

Good luck

>Meetings.dbf
>
>
>Meetings.dbf
>
>lastname,firstname,isblock,blockslot,schdate
>
>blocks.dbf
>
>lastname,firstname,blockslot,schdate
>
>
>
>In the first table individual patients are scheduled or a block is defined. If it is a block than isblock=.t..
>
>I need a query that returns a cursor of dist cases for a given date from both tables.
>
>Example:
>
>Meetings.dbf with 2 records
>LASTNAME   FIRSTNAME   ISBLOCK   BLOCKSLOT   SCHDATE
>=======================================================
>KELLY      KIRK         .F.        1234      10/07/2001
>BLOCK      BLOCK        .T.        1235      10/07/2001
>
>Blocks.dbf with 1 record
>
>LASTNAME   FIRSTNAME   ISBLOCK   BLOCKSLOT   SCHDATE
>=======================================================
>KELLY      ROGER        .F.        1235      10/07/2001
>
>
>Desired Results:
>
>LASTNAME   FIRSTNAME   ISBLOCK   BLOCKSLOT   SCHDATE
>=======================================================
>KELLY      KIRK         .F.        1234      10/07/2001
>KELLY      ROGER        .F.        1235      10/07/2001
>
>
>
>Any help greatly appreciated
>
>Kirk
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform