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!

Getting first character 1

Status
Not open for further replies.

Gatorajc

MIS
Mar 1, 2002
423
US
This is an easy one. I know I did it before just cant find it. I have a column with the following data.

I-w654534-rer
2-e564654-hkh
1-e546544-dre

I want to just get the first character left of the first -.

Thanks in advance.

AJ
[americanflag]

If at first you do not succeed, cheat!


 
Sorry a little to vague. I want to query on the character just left of the first -



AJ
[americanflag]

If at first you do not succeed, cheat!


 
Try this:
Code:
Left('I-w654534-rer',CHARINDEX('-','I-w654534-rer')-1)

~Brian
 
I found the answer I was looking for already.

substring(TempID,1,1)

Thanks anyway.

AJ
[americanflag]

If at first you do not succeed, cheat!


 
After further review. I went with your suggestion Brian.

Thanks

AJ
[americanflag]

If at first you do not succeed, cheat!


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top