Last post Feb 06, 2013 08:49 PM by Decker Dong - MSFT
Feb 05, 2013 11:12 AM|vitordf|LINK
I am struggling to replicate a formula that I've built in excel into a SQL query, help is very much appreciated.
The result is the location where the number is e.g.
abc14 = 1st numeric is located as the 4th character
1abc5 = 1st numeric is located as the 1st character
a5bc6 = 1st numeric is located as the 2nd character
ab67c = 1st numeric is located as the 3rd character
I believe that this SQL works (can't test it cause I don't have SQL installed) and off course is not working in Access...
SELECT Case when PATINDEX('%[0-9]%',Col1)>0 then PATINDEX('%[0-9]%',Col1) else 1 end 'Position of Numeric Character' FROM MyTable
Any help is greatly appreciated.
Thanks in advance,
Feb 06, 2013 08:49 PM|Decker Dong - MSFT|LINK
Yes, as far as I see, until now Access doesn't seem to have such a function. So you cannot do that directly.
I mean: You can try to use Mid function of VBA programming for Access