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

Query: Display Part of Field 1

Status
Not open for further replies.

mcgettge

IS-IT--Management
Nov 4, 2002
30
0
0
US
I am looking to write a query that takes part of a field and displays it. The problem is that the length is not constant. I have a table full of addresses with City, State ZIP in the same field. Using the left and right functions I am able to separate and create a field for State and ZIP since they are always 2 and 5 places, but the city length varies. There is a comma in the field that I was hoping I could use to draw the limit with. Any ideas would be greatly appreciated.
 
Use the InStr function to get the comma, then the left can be used:

Left([YourFieldName], InStr(1, [YourFieldName], ",") -1)

Good luck! Anthony J. DeSalvo
President - ScottTech Software
"Integrating Technology with Business"
 
Thank you for the help....works perfect.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top