View Full Version : Query help


drpkrupa
06-01-2009, 04:56 PM
I have a table and table has two column.
ID Variable
1 1.1_D4.M
2 1.2_D8.TP
3 4_K9.D
4 6.9_L9.M
5 1.1_D4.M
6 6.9_L9.M

I want a write query which will return all charcters before "_" and distinct value.

Result.
1.1
1.2
4
6.9

pbaldy
06-01-2009, 04:59 PM
You can use the Left function along with the InStr function to find the position of the underscore. You should be able to group on that to get your distinct list.