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

How to take a substring form a field? 1

Status
Not open for further replies.

patyavila

Technical User
Apr 29, 2004
28
US
Well, I must say first of all THANX to everyone! I allways receive good tips :)
Have a field that contains "word1 word2 word3 ...". What I need is to show in a report only the first word. I'm quite new in Access, but experienced in programming and know there may be functions that help: find(), substr(), etc.
Any ideas?
Thank you
 
Use the Mid$ function:

Code:
Mid$([[i]fieldname[/i],1,Instr(1,[[i]fieldname[/i]]," ")-1)

This code selects the characters starting at the left and searches for the first space. All to the left of this space is returned.

Bob Scriver
[blue]Want the best answers? See FAQ181-2886[/blue]


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top