How to replace string with variable in substring? btw im using vb
I have a below query that work fine but I just want to replace "ra*" with a variable. How can I do this?
SELECT DISTINCT a.[rank], b.Description
FROM CONTAINSTABLE(myTable, *, '"ra*'") AS a
INNER JOIN myTable AS b ON a[key] = b.ID
ORDER BY a.rank desc;
Below is what I tried so far but it doesnt work. it treat as '"ra"' and not '"ra*"'. Any idea how can I fix this?
Dim mkey As String = "ra"
Dim query As String = "SELECT DISTINCT a.[rank], b.Description
FROM CONTAINSTABLE(myTable, *, '" & mKey & "*') AS a
INNER JOIN myTable AS b ON a[key] = b.ID
ORDER BY a.rank desc;"