I’m pulling data from an SQL database, with an input of part number which is in the format of X-NNNN-NNNN sometimes with a suffix of -NN or -XXX, and i want to ignore that suffix.
My SQL querie is as follows:
select *
from [MPD_Service].[dbo].[Configuration]
where [Part_Number] LIKE $Part_Number$+’%’
Part_Number in the database is always X-NNNN-NNNN and the input might be things such as:
X-NNNN-NNNN or,
X-NNNN-NNNN-NN or,
X-NNNN-NNNN-XXX
In my understanding the ‘+’%’ wildcard should work, but its not. Only the first case above works, the other 2 return ‘null’
Sorry but i don’t see how your suggestion relates to my issue.
After some testing in SQLFiddle.com i managed to find a solution that tests out ok there:
SELECT * FROM [Configuration] WHERE partNo LIKE LEFT(@Input,11)
but that does not work in Tulip.
In fact the solution is: where [Part_Number] LIKE LEFT($Part_Number$,11)+’%’
I was almost there, but thank you Tulip support for giving the final answer.