Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Reccount() & Deleted Records

Status
Not open for further replies.

keepingbusy

Programmer
Apr 9, 2000
1,470
GB
Hi All

Quick question. How can I show how many records there are in a DBF excluding the deleted records. I know that the value RECCOUNT( ) returns isn't affected by SET DELETED and SET FILTER. So for example if there are 35 employees in a DBF but there have been perhaps 5 previous who are deleted from the table (Bearing in mind this is before the PACK command is issued), how can I just show the 35?

Many thanks
KB When everything else is said and done, there will be nothing else to say or do! God Bless everyone....
 
keepingbusy

SELE TABLENAME
lnRecNo = RECN()
COUNT FOR !DELETED() TO lnReccount
GO lnRecNo
HTH

Chris [pc2]
 
keepingbusy

Code:
SET DELETED ON
SELECT myTable 
COUNT TO X
MESSAGEBOX("There are "+alltrim(transform(x))+" records in this table")
Mike Gagnon
 
count for deleted() to zm_d
count for !deleted() to zm_n
Monika Kind regards to you all from Warsaw !!!!!
 
Thanks a million for that very quick response!!
KB When everything else is said and done, there will be nothing else to say or do! God Bless everyone....
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top