MS Access Contains query

自闭症网瘾萝莉.ら 提交于 2019-11-29 14:33:00
Tony Hopkinson

Query in MS Access:

select * from SomeTable Where SomeColumn Like '* PARMA *'

For standard SQL, it would be like '% PARMA %'

Note that the above statement would not find 'PARMA', 'CHOPE PARMA', or CHOPE PARMAHAM 101', or any value with that contains PARMA; to do so just remove the spaces in the search string, e.g. '*PARMA*'

select * from SomeTable Where SomeColumn Like '*PARMA*'

Are you asking about using the Like condition?
If so, there's more info here

MS Access: LIKE Condition (using wildcards) in Access 2003/XP/2000/97

The LIKE condition allows you to use wildcards in the where clause of an SQL statement in in Access 2003/XP/2000/97. This allows you to perform pattern matching. The LIKE condition can be used in any valid SQL statement - select, insert, update, or delete.

The patterns that you can choose from are:

* allows you to match any string of any length (including zero length)
? allows you to match on a single character
# allows you to match on a single numeric digit

For Example

Like 'b*'   would return all values that start with b
Like '*b*'  would return all values that contain b
Like '*b'   would return all values that end with b
Like 'b?'   would return all values that start with b and are 2 characters in length
Like 'b#'   would return all values that start with b and are 2 characters in length
where the second character is a number
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!