Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Always trips me up!
Message
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Database:
Visual FoxPro
Divers
Thread ID:
01233129
Message ID:
01233185
Vues:
16
I ran the two first selects and I see the problem.

In the StatusHistory table we should have a PK, say, StatusID.

The code should be
SELECT Mb.*, Sh.* ;  
  FROM Members mb ;  
  INNER JOIN StatusHistory sh ON Mb.MemberId = sh.MemberId ;  
  WHERE sh.StatusId IN ;  
          (SELECT CTOBIN(RIGHT(MAX(DTOS(ChangeDate)+BINTOC(StatusId )),4)) ;  
              FROM StatusHistory GROUP BY MemberId )
That's what happens when you write code based on a sample :)

You're a cheater by not creating PK in StatusHistory :)
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform