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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help needed with selecting duplicate values.

Status
Not open for further replies.

stormtrooper

Programmer
Apr 2, 2001
266
CA
Hi there. I have a report (CR7) in which I want to report on the duplicate values using the 'mid' function. That is, for example I have the following:

...
ABCD1234AB
ABCD1278AB
ABCD1278CD
ABCT3458TD
...
etc.

The data above is what is contained in the field called {My_Field}. Now looking at that, there is clearly no duplicates. But when you apply the 'mid' function:

mid({My_Field, 1, 8)

then there are duplicates. (ABCD1278 and ABCD1278)

What I want to do is report on the duplicated values after the 'mid' function is applied. I'm kind of thinking that I will have to use the 'previous' function somehow to compare then apply all that to my select expert. Please help.

Thanks in advance. Let me know if more info is needed.
 
A simple means might be to create a formula on

left({Table.Field},8)

And group on it, place it in the details, right click and select insert summary->count, drag the value into the group header and base the detail suppression on the count being 1.

I think that works, but I'm a bit tired today.

As for doing this in the select expert, I can't think of a simple means to do this. You might create a View on the database with a similar sort of grouping in it which returns rows which:

having count(*) > 1

-k kai@informeddatadecisions.com
 
Sorry, I forgot to reply that I got the solution about 2 minutes after I posted.

Vampire, that was exactly to the tee of my reasoning! I ended up using the first method. I did not want to get into writing a view for a simple report.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top