Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Gaps in Check Sequence?
Message
 
 
To
14/11/2003 16:39:13
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00850077
Message ID:
00850118
Views:
22
>If I have a series of checks say 1, 2, 3, 4, 6, 7, 8 - how can I write a SQL statement to show that the number FIVE (5) is missing in this sequence?

I don't think you can do it with one select in VFP. Try
SELECT MAX(CheckNumber) FROM mytable INTO ARRAY laMaxCn
CREATE CURSOR crsTemp ( CheckNumber I)
FOR i=1 TO laMaxCn[1]
	INSERT INTO crsTemp VALUES (i)
ENDFOR
SELECT  CheckNumber ;
	FROM crsTemp ;
	WHERE CheckNumber NOT IN ( SELECT CheckNumber FROM mytable ) ;
	INTO CURSOR crsResult
--sb--
Previous
Reply
Map
View

Click here to load this message in the networking platform