We help IT Professionals succeed at work.

How to parse field and select and display in combo box only entries that are distinct at mid([Serial Number],6,2)

kes3
kes3 asked
on
281 Views
Last Modified: 2010-03-20
I want to parse, select and display in a combo box only entries that are DISTINCT at mid([Serial Number],6,2).
The field [serial numbers] is of the form
X-NN-YY
where X is a letter, NN is a sequential number and YY is the two digit year.
The field [serial numbers] contains other random data that does not matter.
The table that [serial numbers] comes from is [all].
The combo box would then ideally look like:
07
06
05
04
03
How do I do this with an SQL statement.
Comment
Watch Question

CERTIFIED EXPERT
Most Valuable Expert 2015

Commented:
The exact syntax depends on your database. For sql server

select distinct substring([serial numbers], 6, 2)
from   yourTable

If you want the 6th position of the "sequential number" (not the entire serial number) let me know.
CERTIFIED EXPERT
Most Valuable Expert 2015
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.