ey****@ncsa.uiuc.edu wrote:
sSQL = "SELECT *" & _
" FROM 06_Statements" & _
" WHERE [Billing Date] = '23-DEC-2005'" & _
" And [Total Charge] > 0" & _
" AND Description LIKE'Cellular" & "*" & "'" & _
" ORDER BY [Service Number]"
set rs = Connect.Execute(sSQL)
Can someone tell me what's wrong wth this?
" AND Description LIKE'Cellular" & "*" & "'" & _
I've also tried
" AND Description LIKE'Cellular*'" & _
as well as other versions.
This works find but I need to grab other things with "Cellular" in
them.
" AND Description LIKE'Cellular Roaming Charges'" & _
When running queries via ADO, you must use ODBC wildcards (% and _) instead
of (* and ?) regardless of what database backend you are using.
Having said that, your use of dynamic sql is leaving you open to hackers
using sql injection as well as performance impairment. You should consider
using parameters instead:
http://groups-beta.google.com/group/...e36562fee7804e
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.