开发者

Is their a posIndex in MS Access Queries?

开发者 https://www.devze.com 2023-01-21 01:22 出处:网络
I need to write a query like SELECT substring(variable, startPosIndex, endPos) from Blah blah ; startPostIndex = indexPositio开发者_如何学编程n(\'#\')

I need to write a query like SELECT substring(variable, startPosIndex, endPos) from Blah blah ;

startPostIndex = indexPositio开发者_如何学编程n('#')
endPos = lenght(variable) - 1;

So basically my query to access will be

SELECT substring(variable, indexPosition('#'), lenght(variable) - 1) from Blah blah ;

The query that I have written to get if a field has anything after a "#" in a tuple is

SELECT DISTINCT Mid(geninq.entry,InStr(geninq.entry,"#"),Len(geninq.entry)) AS Expr1
FROM geninq
WHERE (((geninq.entry) Like "*[#]*"));


I think the function you're looking for is InStr: InStr(String, '#').

0

精彩评论

暂无评论...
验证码 换一张
取 消