LIKE

SELECT * FROM People WHERE LName LIKE 'Sm%'

The SQL Statement above will retrieve

ALL fields: SELECT *

From the table named People: FROM People

With the requirement that the LName starts with Sm: WHERE LName LIKE 'Sm%'


If this is the original table
People
FNameLNameCategory
JohnSmith1
AlJones2
FredSmothers2


Your recordset returned would be this:
People
FNameLNameCategory
JohnSmith1
FredSmothers2


You can also do like this:
LIKE '%th' -- ends in th
LIKE '%e%' -- has an e in it



Come learn HTML or Classic ASP in Honolulu, Hawaii!

HOME | SQL Tutorials | XML Tutorials | OKIWEB | EMAIL ME | ASP Alliance