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!

Query help recognize repetition in a field 1

Status
Not open for further replies.

bravo6

IS-IT--Management
Mar 23, 2006
83
US
I am trying to write a query to state whether a trip is round-trip or one way. The field I am working with is the itineray field which may look like this: BOS-DFW-BOS or BOS-DFW-PHX. Each three letter code is an airport code so the first example would be a round trip from Boston to Dallas and return. The second example would be a one way from Boston through Dallas to Phoenix.

Is there a way to write a query to see the repetition of "BOS" in the first example and call it Round Trip and if no repetition call it One Way.

Your help, as always, is greatly appreciated.

Dave
 
In a field cell of the query grid:
TypeOfTrip: IIf(Left([itineray field],3)=Right([itineray field],3),'Round Trip','One Way')

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top