Link to home
Create AccountLog in
Avatar of kes3
kes3

asked on

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

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.
Avatar of _agx_
_agx_
Flag of United States of America image

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.
ASKER CERTIFIED SOLUTION
Avatar of _agx_
_agx_
Flag of United States of America image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer