Using CHAR() in criteria

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,

Thanks in advance!

I am trying to only look at the first character in some data in my criteria.
I tried this, but it does not work.
How do I do this?

char(1)="S"
 
Can the MID(x,x,x) be used in a criteria of a query? If so, how would I make
it conditional?

I guess this is an example of what I'm trying to do, but this is in VB not a
query criteria.

x = MID(y,1,1)
if x = 'S' then
 
Guessing that Y is a field

WHERE Mid([y],1,1) = 'S'

In the query grid:
Field: Expr1: Mid([Tablename].[y],1,1)
Criteria: "S"

Or you can use a wild card query.

For the first character

Field: [Y]
Table: Tablename
Criteria: Like "S*"

or for the third character in the string
Field: [Y]
Table: Tablename
Criteria: Like "??S*"
 
Back
Top