sql query for specific conditions on field

access 2010
sql query for specific conditions

I have an sql query where i need the following additional criteria:
length of string
 no numerics

SELECT DISTINCT AGI_CROSS_REVIEW_2.MFG, Count(AGI_CROSS_REVIEW_2.MFG) AS CountOfMFG
FROM AGI_CROSS_REVIEW_2
GROUP BY AGI_CROSS_REVIEW_2.MFG
ORDER BY Count(AGI_CROSS_REVIEW_2.MFG) DESC;

Open in new window


The MFG field needs to be:
Length greater than 4
MFG field can not  contain any numeric in the data

Thanks
fordraiders
LVL 3
FordraidersAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

ste5anSenior DeveloperCommented:
You already said it, thus just use it:

SELECT CR.MFG, Count(*) AS CountOfMFG
FROM AGI_CROSS_REVIEW_2 CR
WJERE Len(CR.MFG & "") > 4
GROUP BY CR.MFG
ORDER BY Count(CR.MFG) DESC;

Open in new window

0
FordraidersAuthor Commented:
but i also need to exclude  records where a Numeric value exists in the MFG field.

fordraiders
0
ste5anSenior DeveloperCommented:
SELECT CR.MFG, Count(*) AS CountOfMFG
FROM AGI_CROSS_REVIEW_2 CR
WJERE Len(CR.MFG & "") > 4 
AND NOT IsNumeric(CR.MFG & "")
GROUP BY CR.MFG
ORDER BY Count(CR.MFG) DESC;

Open in new window

0
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

Dale FyeOwner, Developing Solutions LLCCommented:
"exclude records where a numeric value exists in MFG field"

Does this mean, no numbers, anywhere in the [MFG] field?  If so:

SELECT CR.MFG, Count(*) AS CountOfMFG
FROM AGI_CROSS_REVIEW_2 CR
WJERE Len(CR.MFG & "") > 4
AND NOT CR.MFG Like "*[0-9]*"
GROUP BY CR.MFG
ORDER BY Count(CR.MFG) DESC;
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
FordraidersAuthor Commented:
DALE, actually yes...Thanks
0
PatHartmanCommented:
This makes for very inefficient queries.  Wouldn't it be better to not allow the invalid data to begin with.
1
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.