Query #character

sallee77

New Member
Joined
Mar 17, 2005
Messages
41
Hi There!

Novice Access User here (running on SQL Server).

I have records that contain an indicator of ##. I need to run a query to only return records that have this indicator. I've tried the below, however it is returning records that have 2 numbers (EG instead of returning "TOWN HALL ##" it is returning "TOWN HALL (H.6.2.09)"

SELECT dbo_Master.[Problem Store Name]
FROM dbo_Master
WHERE (((dbo_Master.[Problem Store Name]) Like '*##*'));

Is it possible to query the # as the symbol itself rather than a wildcard for a number?

any help would be greatly appreciated!

Thanks!
 

Some videos you may like

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
76,061
Office Version
  1. 365
Platform
  1. Windows
I don't know if this will help but.
MS Access Help said:
Note To match the special characters left bracket ([), question mark (?), number sign (#), and asterisk (*), enclose them in brackets. The right bracket (]) can't be used within a group to match itself, but it can be used outside a group as an individual character.
 

sallee77

New Member
Joined
Mar 17, 2005
Messages
41
THANKYOU!

Many thanks for the suggestions!

I've worked it out, using:

SELECT dbo_Master.[Problem Store Name]
FROM dbo_Master
GROUP BY dbo_Master.[Problem Store Name]
HAVING (((dbo_Master.[Problem Store Name]) Like "*[##]*"));

Thanks for your assistance!

Merry Christmas
 

Watch MrExcel Video

Forum statistics

Threads
1,118,676
Messages
5,573,603
Members
412,538
Latest member
mrjack
Top