HaworthBantam
Programmer
I am creating a sql string....
MySQL = "SELECT * FROM tblRemissions WHERE CustomerName LIKE '*" & strVariable & "*'" & " ORDER BY RemissionID"
strVariable is as it suggests, is a string variable.
If I use a sql string where the whole name is known....
MySQL = "SELECT * FROM tblRemissions WHERE CustomerName = " & strVariable & " ORDER BY RemissionID"
....it works.
Is any kind soul out there able to point out my mistake ?
Thanks.
MySQL = "SELECT * FROM tblRemissions WHERE CustomerName LIKE '*" & strVariable & "*'" & " ORDER BY RemissionID"
strVariable is as it suggests, is a string variable.
If I use a sql string where the whole name is known....
MySQL = "SELECT * FROM tblRemissions WHERE CustomerName = " & strVariable & " ORDER BY RemissionID"
....it works.
Is any kind soul out there able to point out my mistake ?
Thanks.