Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL 1

Status
Not open for further replies.

jtgurkin

Technical User
Sep 16, 2002
47
US
I need to pull the following SQL statement from an MSAccess DB. It doesn't work as I have it written, how can I fix it?

Code:
SELECT * FROM Addresses WHERE Years CONTAINS 2004

Code:
Years
is a string field with a series of years seperated by semicolons like this "2000;2001;2002;2003;2004"
 
The wildcard character for Access is *. So, you need to make the database engine see something like:
SELECT * FROM Addresses WHERE Years Like *2004*

Bottom line is that you really need to redesign your table.

 
How would you reccomend I redesign this? The list is the particular years a person participated in this group. They aren't usually consecutive, it's more like 1998; 2000; 2001; 2003
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top