>FOR i=1 to m.lnFields > IF !INLIST(FIELD(m.I), "PROJNO", "COMMENTS", "UNIQKEYSAS", "UNIQKEYBAY", ; > "YEAR", "NEWREC", "DISPUTE", "PRO_DATE", "DRAWDATE" ) > lcGroupBy=m.lcGroupBy+field(m.i)+iif(m.i=m.lnFields,'',',') > ENDIF >ENDFOR <b> if right(m.lcGroupBy,1)=',' lcGroupBy=left(m.lcGroupBy,len(m.lcGroupBy)-1) endif </b> >select *, count(*) as cntDups ; > from tmpdbf ; > group by &lcGroupBy ; > having cntDups>=2 ; > into cursor curDups > > isduprec = .t.