Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Odd JOIN of two tables not getting desired results
Message
De
26/07/2006 07:06:42
Jay Johengen
Altamahaw-Ossipee, Caroline du Nord, États-Unis
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Odd JOIN of two tables not getting desired results
Versions des environnements
Visual FoxPro:
VFP 8 SP1
Divers
Thread ID:
01140102
Message ID:
01140102
Vues:
67
I have two tables. MyTransactions has transactional data by date (TranDate). The other, MyValues, is non-normalized with a daily valuation by date (ValDate). The MyValues table is not transactional in the sense that a value is applied each of the days, but rather the value is displayed on each day after it is initially applied (see 05/01/2006). The basic layout is like this:
MyTransactions

AAA     01/01/2006     100
BBB     03/15/2006     200
CCC     05/23/2006     300
DDD     06/01/2006     400
EEE     06/26/2006     500

MyValues

FFF     01/01/2006     000
GGG     02/01/2006     000
HHH     03/01/2006     000
III     04/01/2006     000
JJJ     05/01/2006     555
KKK     06/01/2006     555
LLL     07/01/2006     555

MyDesiredResults (added 05/01 record)

AAA     01/01/2006     100     000
BBB     03/15/2006     200     000
JJJ     05/01/2006     000     555
CCC     05/23/2006     300     000     
DDD     06/01/2006     400     000
EEE     06/26/2006     500     000

Or if the MyValues table had an entry for 05/23, then I would want one record in the results with both column values like this:

MyDesiredResults (added 05/01 record)

AAA     01/01/2006     100     000
BBB     03/15/2006     200     000
CCC     05/23/2006     300     555     
DDD     06/01/2006     400     000
EEE     06/26/2006     500     000

I've tried various ways, but just can't seem to get the right combination of JOINS, NULLS, etc.
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform