Substring question

ogrerugby

New member
Local time
Today, 17:03
Joined
Nov 26, 2003
Messages
6
I have a quick question that should be easy but I'm fairly new to Access. I have a table with one column named "descriptor" and the data is in this format:

123-456-7890-1111
5555-6666-7777-123
45654-214-233-4562

There are always 4 values and they are delimited by "-". I just need a query to get the sum of the 4th set of values. If I need to do 2 queries that's fine too. I'm just not sure how to get the 4th part of the fields since the position is not always the same.

thanks
 
Try this expression:

Right([Field1],Len([field1])-InStr(InStr(InStr([Field1],"-")+1,[field1],"-")+1,[Field1],"-"))

You will need to replace "Field1" with your field name.

GumbyD
 
Bingo

It works. Thanks alot!
 

Users who are viewing this thread

Back
Top Bottom