Hi,

SELECT *
FROM veriler
WHERE (name LIKE '%in%')

This line doesn't work in Ms Access, IN either. No error is given is well. But It works in SQL server. How can i do in Access?

Thanks

Dani AI

Generated

Short summary and practical gotchas (builds on and )

The behavior you saw comes from two different SQL dialects and where the SQL is executed. Access has historically used a legacy SQL mode for its local engine; other modes (and SQL Server) use different wildcard characters and slightly different syntax. That means the same LIKE text can work in one environment and not return results in another.

Checklist to fix and troubleshoot

  • If working inside Access queries/forms/reports, confirm which SQL mode the database uses (there is an option in Access to enable the newer ANSI-92 query mode). Changing that mode switches which wildcard characters are recognized and can affect existing saved queries, so back up first.
  • If the SQL is sent directly to SQL Server (pass-through queries, linked ODBC pass-through, or code that executes SQL on the server), it runs under the server dialect — use server-style patterns there.
  • Avoid using reserved words as field/parameter names (for example name or in) or ambiguous names; bracket field names when in doubt.
  • When building queries from VBA, use parameterized QueryDefs or parameters instead of string concatenation to avoid quoting/wildcard mistakes and to prevent SQL injection. Also prefer the & operator for concatenation in Access VBA to avoid numeric coercion.

Extra tips

  • If a LIKE returns no rows even though you expect matches, verify the field is text (not numeric), check for trailing control characters, and confirm whether the query is local or passed through to a server.
  • Turning on ANSI-92 makes Access and SQL Server behavior more consistent across environments; consider enabling it for projects that mix Access front ends with SQL Server back ends, but test thoroughly because it can change query results and indexes.

Recommended Answers

All 2 Replies

answer is
WHERE name LIKE ('*' & in & '*')

commented: Good find! +1
commented: =D +4

The Asterisk * is the wild card for the LIKE operator in Access.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.