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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Parameter with number and letter... 2

Status
Not open for further replies.

abradford

MIS
Oct 12, 2006
31
0
0
US
I have a parameter query which asks to enter in an Office number The problem is that there are office numbers which include letters, like 4044b. So when the query asks me to enter in office number I want to enter in 4044 and have all records displayed that have office of 4044 as well as anything else, like 4044b, 4044c, 4044d. How would I work that into the query? Thanks!
 
Code:
where left(MyField, 4) = MyParameter

should do the trick.

Hope it helps,

Alex

A wise man once said
"The only thing normal about database guys is their tables".
 
or
Code:
where MyField LIKE & "'" & MyParameter & "*'"
 
thanks, however, off couse, i am failing to get this to work, do to me being newish and not knowing where to put parens...here is my code:

SELECT [Active Directory].LastFirst, [Active Directory].Email, [Active Directory].AgentNumber, [Active Directory].AGT, [Active Directory].BSO
FROM [Active Directory]
WHERE ((([Active Directory].BSO)=[Enter BSO]));
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top