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

SQL Query

Status
Not open for further replies.

ncopeland

IS-IT--Management
Mar 12, 2002
88
GB
I have two tables. I want to join them. The field in the first table is a 4 character field. The second table has a field that is 8 characters long. I want to join the 4 character field to the field in the second table. The problem is the field I want to join it too needs to start at character position 2 and finish at character position 5. If this was crystal programming I would strip it out using MID(field,2,4).

Any help greatly appreciated.
 
select a.field1, b.field2
from a join b on a.keyfield = substring(b.keyfield,3,4)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top