SET DATE GERMAN
SET CENTURY on	
CLOSE TABLES
CLOSE DATABASES
SET DELETED ON
OPEN DATABASE \\nedjo\c\2009\baze\belcar SHARED
USE \\nedjo\c\2009\baze\kalkstav ALIAS kalk9 SHARED IN 0

OPEN DATABASE d:\2010\robno\baze\belcar SHARED
USE d:\2010\robno\baze\kalkstav ALIAS kalkstav SHARED IN 0

SELECT kalk9
SET ORDER TO tag sifrob1
GOTO top

SELECT kalkstav
GOTO top
DO WHILE !EOF()
IF kalkstav.brdok<>"PS/2010"
	SKIP
	LOOP
ENDIF
?kalkstav.brdok,kalkstav.sifrob
msif=kalkstav.sifrob
mnce=kalkstav.ncena
SELECT kalk9
GOTO top
SEEK msif
DO WHILE !EOF()
IF kalk9.datum>CTOD("31.12.2009")
	SKIP
	LOOP
ENDIF
IF kalk9.kolicina<>0 .and. kalk9.ncena<>0
	mnce=kalk9.pcena
	SELECT kalkstav
	replace kalkstav.ncena WITH mnce
	replace kalkstav.dobcen WITH mnce
	EXIT
ENDIF
SKIP
ENDDO
SELECT kalkstav			
SKIP
ENDDO
	