*OPEN DATABASE C:\APOTEKA\BAZE\APOTEKA SHARED
SET EXCLUSIVE ON
CLOSE ALL
USE c:\apoteka\baze\FAKSTAV ALIAS fakstav SHARED IN 0
USE c:\apoteka\baze\zagfak  ALIAS zagfak  SHARED IN 0
SELECT FAKSTAV
SET ORDER TO tag brdok
GOTO top
SELECT zagfak
GOTO top
DO WHILE !EOF()
a=zagfak.kupdob

SELECT fakstav
GOTO top
SEEK zagfak.brdok
DO WHILE BRDOK=ZAGFAK.BRDOK
IF FOUND()
	replace kupdob WITH a
ENDIF
SKIP
ENDDO
SELECT zagfak
SKIP
ENDDO
RETURN
