> >
> >
> >
* create some test data
> > CREATE CURSOR test (fldA C(1))
> > INSERT INTO test VALUES ("A")
> > INSERT INTO test VALUES ("B")
> > INSERT INTO test VALUES ("C")
> > INSERT INTO test VALUES ("A")
> > INSERT INTO test VALUES ("A")
> > INSERT INTO test VALUES ("D")
> > INSERT INTO test VALUES ("C")
> > * get duplicates
> > SELECT flda, COUNT(*) as ncount ;
> > FROM test ;
> > GROUP BY flda ;
> > HAVING ncount > 1 INTO CURSOR junk
> >
> > * Put result in one row
> > CREATE CURSOR JUNK2 (FldDup M)
> > SELECT junk
> > m.lcScan = ''
> > SCAN
> > m.lcScan = m.lcScan + ALLTRIM(fldA)+" = "+ALLTRIM(STR(ncount))+" AND "
> > ENDSCAN
> > * Remove the last occurence of " AND"
> > INSERT INTO JUNK2 VALUES (left(m.lcScan,LEN(ALLTRIM(m.lcScan))-4))
> > SELECT junk2
> > BROWSE
> >
> >
> > I used memo field type in this test because there is no fixed field width with what you need.
> >
> >
> > Jun Tangunan
> >
> > "Get out of the past and look in the future."
> >
http://weblogs.foxite.com/sandstorm36/>
> Wow! You already knew SQL Statement?
>
> CriZ (,")
>
> "Everyone is entitled to their own opinion, but not their own facts."
Little by little. :-U However that COUNT(*) as ncount came from Eric.
That is why I love trying to solve other's problem. It gives me the chance to study some things which I normally don't encounter. ;-)
Jun Tangunan
"Get out of the past and look in the future."
http://weblogs.foxite.com/sandstorm36/