Monday, March 26, 2012

query from hell

if when the data is in mdb format the below query works

SELECT *
FROM [rating & px Tgt History]
WHERE ((([from] Like "*Init*" And [action] Like "*Target*")=False and deleted=false));

but when the access linked to backend is sql server via odbc i get this

ODBC call failed
{microsoft][odbc sql server driver][sql server]line 1:incorrect syntax near '=' #170

One thing that jumps out at me is the asterisk * needs to be a %... ex: Like '%Init%' ... the only other thing that looks wrong is you are using double quotes.. try using single quotes.

No comments:

Post a Comment