Full Version: Query Conversion
UtterAccess Discussion Forums > And More... > Microsoft SQL Server
satishchandrat
Was trying to convert an access query to SQL.
One of the where conditions are
WHERE (((([tblA].[Ward]) Like "expired not") Not Like "damaged"))

What could be equivalent TSQL for this.
Jeff B.
First of all, there are no wild-card symbols with those "Like" statements, so you'd be getting the same result as if you'd used "=".

If you truly mean "something like", then add wild-card symbols.

Then, I'm not familiar with the construction/syntax ... did you copy that directly from the SQL window in Access?
satishchandrat
The where condition part, is copied from the SQL view of the access query.
WHERE (((([tblA].[Ward]) Like "expired not") Not Like "damaged"))
Original access query was written by some programmer.

If no wild card characters are used, would it be equivalent to "=".
On Access would this condition behave like
WHERE (((([tblA].[Ward]) = "expired not") <> "damaged"))

Need an TSQL equivalent for this condition..

Jeff B.
Is it the [Ward] that is supposed to be either similar to or exactly equal to "expired not"?

Is it the [Ward] that is supposed to be not similar to or not equal to "damaged"?

In Access, it all starts with the data. What kind of data is being stored in that field (?[Ward])?
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.