General information
Category:
Coding, syntax & commands
Title:
Looking for records not found
Hi all,
I'm trying to search a table for 'missing' records. I want to scan through my 'agency' table for agency i.d. codes, then search another table (newinit in this case) to see if there is a record for agency code (field=acode) = the value found in the scan of the agency table.
I'm using the following code to do this (VFP5.0), but I'm coming up with an endless loop in the DO WHILE section in which I'm getting 'millions' of records with acode=myscanvalue, but a new ntid (my key field formy newinit table) and I have to cancel the program.
Any clue what I'm doing wrong here?
*****
USE newinit
USE agency in 0
SELECT agency
SET ORDER TO acode
GO TOP
SCAN
myscanvalue=alltrim(acode)
SELECT newinit
LOCATE FOR alltrim(acode) = myscanvalue
DO WHILE !FOUND( )
SET ORDER TO ntid
GO BOTTOM
x=ntid
x='00'+alltrim(str(val(x)+1))
APPEND BLANK
REPLACE acode with myscanvalue
REPLACE ntid with x
ENDDO
SELECT agency
ENDSCAN
********
MTIA!!
Mandy
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only