sql statement w/ where clause of part of a field.

S

SteveN

Could someone tell me how I might be able to construct a
sql statement with a where clause that matches only part
of the field?

For example I'd like to do a select statement with a
where clause that matches the first three digits of a
column/field. ie SELECT * FROM ABC WHERE XYZ = 123.

ABC = table name
XYZ = column
123 = the first three digits of XYZ column (note the XYZ
column could contain 123789 or 123546 and they would be
selected). Thanks in advance for any suggestions!
 
D

Duane Hookom

SELECT * FROM ABC WHERE XYZ Like "123*"
or
SELECT * FROM ABC WHERE Left(XYZ,3) = "123"
 

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