ZURINET
asked on
Search Error
Hi all
I have a code snippet below used to search for values in table
I am having problem with searching for values with 00 as string
why would the query be returning only the first records set and not the rest of 100's
The command is run withing the store procedure
set @sql_where = ' and (Table.F0ArtNr like '''+@strSuchStr+''')'
The where statement goes = where Table.F0ArtNr like @strSuchStr
and
I have a code snippet below used to search for values in table
I am having problem with searching for values with 00 as string
why would the query be returning only the first records set and not the rest of 100's
The command is run withing the store procedure
set @sql_where = ' and (Table.F0ArtNr like '''+@strSuchStr+''')'
The where statement goes = where Table.F0ArtNr like @strSuchStr
and
if substring(@strSuchStr,1,1) = '?'
begin
set @sZahl = substring(@strSuchStr,2,len(@strSuchStr))
end
else
begin
set @sZahl = @strSuchStr
end
if isnumeric(substring(@sZahl,1,6)) = 1
begin
set @iSearchArtNr = 1
end
else
begin
set @iSearchArtNr = 0
end
set @strSuchStr = upper(ltrim(rtrim(@strSuchStr)))+'%'
if substring(@strSuchStr,1,1) = '?'
begin
set @strSuchStr = '%'+substring(@strSuchStr,2,len(@strSuchStr))
end
i didn't understand your problem
ASKER
Hi
Would any of the set @strSuchStr = '%'+substring(@strSuchStr, 2,len(@str SuchStr))
construct be removing 00 in a string
That is if I decide to search for 000999
would the substring be removing the 00 in the string?
Would any of the set @strSuchStr = '%'+substring(@strSuchStr,
construct be removing 00 in a string
That is if I decide to search for 000999
would the substring be removing the 00 in the string?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
What I know is that one of this substring is removing all the 0 digits if the search string starts with 0
ASKER
Will run a test in console and find out which on is doing this