I am trying to use wildcards in SQL
here is the vb code
Dim viewSelectQuery As String = "SELECT " & field & " FROM Sales WHERE ProductCode LIKE ""????BLP*"""
here is what the query string looks like when program is run
"SELECT ProductCode, DateSold, TimeSold, QuantitySold, CostPrice, SoldPrice, PaymentMethod FROM Sales WHERE ProductCode LIKE "????BLP*""
nothing is returned
If I replace the "????BLP*" with an exact ProcductCode I get the rows that match that product code. Am I doing something wrong?
here is the vb code
Dim viewSelectQuery As String = "SELECT " & field & " FROM Sales WHERE ProductCode LIKE ""????BLP*"""
here is what the query string looks like when program is run
"SELECT ProductCode, DateSold, TimeSold, QuantitySold, CostPrice, SoldPrice, PaymentMethod FROM Sales WHERE ProductCode LIKE "????BLP*""
nothing is returned
If I replace the "????BLP*" with an exact ProcductCode I get the rows that match that product code. Am I doing something wrong?