Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
WHERE Not IN
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Environment versions
Visual FoxPro:
VFP 9 SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01512443
Message ID:
01512451
Views:
68
Try
	SELECT ;
		 " " AS CheckOff, a.grpid, a.grpnum, b.lastname, b.firstname, b.dob, a.Hist, a.PlanKey, a.Status, a. Renewal, ;
		a.ptd ;
	FROM grpextcv  a ;
	JOIN grpextin b ON a.grpid+a.grpnum=b.grpid+b.grpnum ;
	WHERE a.Hist="99" AND a.GrpID="ACS" AND ;
		(YEAR(a.ptd) > 1997 AND YEAR(a.ptd) < 2009) AND (a.Status IN ("C, U, T") OR ;
			a.Renewal IN("X, C, L, D")) AND ;
			EXISTS (SELECT grpID FROM grpextin WHERE Status IN("A", "B") AND Hist=a.Hist AND ;
						GrpNum <> a.GrpNum AND grpID = a.GrpID ) ;
		ORDER BY a.grpid, a.grpnum ;
	INTO CURSOR tmpBefore2009_ACS_Only
>This is what I have and it isn't quite working; FoxPro doesn't like the subquery.
>
>
>	SELECT ;
>		 " " AS CheckOff, a.grpid, a.grpnum, b.lastname, b.firstname, b.dob, a.Hist, a.PlanKey, a.Status, a. Renewal, ;
>		a.ptd ;
>	FROM grpextcv  a ;
>	JOIN grpextin b ON a.grpid+a.grpnum=b.grpid+b.grpnum ;
>	WHERE a.Hist="99" AND a.GrpID="ACS" AND ;
>		(YEAR(a.ptd) > 1997 AND YEAR(a.ptd) < 2009) AND (INLIST(a.Status, "C, U, T") OR ;
>		INLIST(a.Renewal, "X, C, L, D")) AND a.GrpID =;
>		(SELECT grpID FROM grpextin d WHERE INLIST(Status, "A", "B") AND Hist="99" AND ;
>		d.GrpNum <> a.GrpNum) ;
>		ORDER BY a.grpid, a.grpnum ;
>	INTO CURSOR tmpBefore2009_ACS_Only
>
>
--sb--
Previous
Reply
Map
View

Click here to load this message in the networking platform