Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Selecting MAX Date
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Selecting MAX Date
Versions des environnements
Visual FoxPro:
VFP 9 SP2
Network:
Windows 2008 Server
Database:
Visual FoxPro
Divers
Thread ID:
01531005
Message ID:
01531005
Vues:
84
I wrote a SQL statement that appeared to be okay, but it has an error:

"SQL: column 'EFF_DATE' is not found".

What did I do wrong? I am trying to not have dupe records. The only way to do that is to get the Maximum Effective Date.
SELECT DISTINCT cv.GrpID, cv.GrpNum, in.Emp_ID, in.LastName, in.FirstName, in.SS_Number, ;
		cv.Eff_Date;
	FROM GRPEXTIN in ;
	JOIN ;
		(SELECT GrpID, GrpNum, MAX(Eff_Date) AS MaxEffDate FROM GRPEXTCV GROUP BY GrpID, GrpNum) cv ;
		ON in.GrpID+in.GrpNum=cv.GrpID+cv.GrpNum  ;
	WHERE cv.Hist ='99' AND ;
		(INLIST(cv.GrpID, "ACS") AND ;
		INLIST(cv.Status, 'A' ,'B') AND ;
		cv.Renewal<>'H') ;
	ORDER BY cv.GrpID, cv.GrpNum ;
	INTO CURSOR tmpResults
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform