OPEN DATABASE \\athlon64\d\belcar\baze\belcar SHARED
USE \\athlon64\d\belcar\baze\parstav SHARED IN 0
USE \\athlon64\d\belcar\baze\brojpar SHARED IN 0
SELECT brojpar
SET ORDER TO tag datum
mbrojac=1
SELECT parstav
SET ORDER TO tag datum
GOTO top
SET near ON
SEEK CTOD("01.01.2008")
SET near off
mdat=datum
skip
DO WHILE !EOF()
IF datum<CTOD("01.01.2008")
	SKIP
	LOOP
ENDIF
mdat1=datum
IF mdat<mdat1
	mbrojac=mbrojac+1
	mdat=mdat1
ENDIF
replace parstav.brpar WITH mbrojac
SELECT brojpar
seek mdat1
IF !FOUND()
	APPEND BLANK
	replace brojpar.brojpar WITH mbrojac
	replace brojpar.datum	WITH mdat1
ENDIF
SELECT parstav		
SKIP
ENDDO
RETURN
