How to write a Contains clause

H

Haji

Hi,

I am trying to search for date value that is contained in
a field that unfortunately also includes other values.
The format for this field is Text which I cannot change.
What I want to do is to search for all values that
contain "01/" or "02/" which should get all of the
dates. Will this work and how would I write the SQL?

Thanks,

Haji
 
J

John Vinson

Hi,

I am trying to search for date value that is contained in
a field that unfortunately also includes other values.
The format for this field is Text which I cannot change.
What I want to do is to search for all values that
contain "01/" or "02/" which should get all of the
dates. Will this work and how would I write the SQL?

The LIKE clause is what you want in this case: put

LIKE "*01/*" OR LIKE "*02/*"

on the criteria line, and it will find all values containing those
strings anywhere within the field. Note that you have no way of
treating it as a real date - "01/30/2003" and "08/01/2002" will both
be found. If you want records where the field STARTS with 01 or 02,
just leave off the first wildcard *.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top