Avatar of smithmrk
smithmrkFlag for United States of America asked on

Check for Duplicates

OK, I need some help with this one!

I have a Query that reformats the data so it can truly look for duplicate items that may have been keyed differently.

For example if someone types in 01256 and someone else put in 1256 it doesn't come up as a duplicate, so I have a query with an Expression that reformats the field to 00001256, puts 20 leading zeros so the number comes out exactly the same no matter how the data was entered.

Now I tried to do a Find Duplicates Query based on this field and I'm getting (see image).

If I put the same format expression in the IN SELECT() then I get overflow error.

How can I get around this without chaning the field to Numeric it needs to stay TEXT!!!

Microsoft Access

Avatar of undefined
Last Comment
Francis Omoruto

8/22/2022 - Mon

Try VAL(your string)
Francis Omoruto

Post the full query please.
All non-aggregate items in the select part of the query must appear in the "group by" clause.
Francis Omoruto

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question

When you use the Format() function, it will first convert your text to number (*overflow*) before attempting the number formatting you require. Try this solution to left-pad your numbers with zeroes:

PaddedAcct: Right(String(20,'0') & [Items].[Account],20)
Good luck!
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck
Log in to continue reading
Log In
Sign up - Free for 7 days
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.

I want to thank everyone for your wonderful suggestions!
I'm on vacation tomorrow, but I will apply some of your ideas on Friday when I'm back in the office, and let everyone know what I find or figure out.


The Format Function was exactly want I needed!!!!
I was trying to do to much wiht CLng and adding / subtracting Lenghts, etc.

Francis Omoruto

You're welcome!
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.