Avatar of cukcuk
cukcuk

asked on 

SQL SELECT with Filtering

Hi,

Is there a way to select from a filtered (while selecting) field at the same time? E.g. I have a table named "info" like following. I need to remove all "-X" and left with only the numerics. Result will be:

ID: 123, 888, 333

It seems like I couldn't do it from Access. Only way I thought of is creating a temporary duplicate table, and filtered it out to a new field, then selecting it.

However, I would like to have it while selecting, it that possible with Access?

Thanks..!

ID
----------
123
123
123-X
888-X
333
333-X
 
SELECT DISTINCT(Left([ID],InStr([ID],'-')-1)) FROM info

Open in new window

DatabasesMicrosoft AccessVisual Basic Classic

Avatar of undefined
Last Comment
game-master

8/22/2022 - Mon