# criteria

C

Catalina Diver

What is the criteria for a query that returns all text that starts with a
"pound sign" - # aka chr$(32)....? I tried "chr$(32) & "*" but it failed
to return anything.

Thanks for your help.
 
T

Tom Wickerath

Hello Catalina Diver,

The # sign has special meaning; it is used to delimit dates in queries or
VBA code. Try using square brackets, as in the following examples:

where field Like "[#]*"

or alternately

where left(field, 1)="#"


Tom
____________________________________

:

What is the criteria for a query that returns all text that starts with a
"pound sign" - # aka chr$(32)....? I tried "chr$(32) & "*" but it failed
to return anything.

Thanks for your help.
 
J

John Vinson

What is the criteria for a query that returns all text that starts with a
"pound sign" - # aka chr$(32)....? I tried "chr$(32) & "*" but it failed
to return anything.

Thanks for your help.

Two things here: you need to use the LIKE operator if you want to use
any wildcards (such as *); and - more subtly - you need to allow for
the fact that the # character is itself a wildcard (matching any
numeric digit).

Try

LIKE "[#]*"

to quote the # and allow the wildcard.


John W. Vinson[MVP]
 
Top