Select string after certain number of characters in MS Access Query (1 Viewer)

Alhakeem1977

Registered User.
Local time
Today, 08:27
Joined
Jun 24, 2017
Messages
308
Hi All,

Need your help to select string after 7 characters in MS Access Query field named [AccountNo] as the below from the first row and the second one:

123456-789
123456-789-123-556

Need to return:

789
789-123-556

Appropriate your earliest response.

Thanks a lot in advance!


Sent from my HUAWEI NXT-L29 using Tapatalk
 

pbaldy

Wino Moderator
Staff member
Local time
Yesterday, 22:27
Joined
Aug 30, 2003
Messages
36,123
Check out the Mid() function.
 

Alhakeem1977

Registered User.
Local time
Today, 08:27
Joined
Jun 24, 2017
Messages
308
Check out the Mid() function.
Thanks for your earliest response, is it like this?

Mid([AccountNo], 7)

It will offset the first 7 characters right?

Sent from my HUAWEI NXT-L29 using Tapatalk
 

MajP

You've got your good things, and you've got mine.
Local time
Today, 01:27
Joined
May 21, 2018
Messages
8,525
mid has three parameters the last is optional
mid(string,start position,number of Characters)
mid(string,7,3) start at 7 go 3 characters
without the last parameter it takes all remaining characters
mid(string,7)
 

pbaldy

Wino Moderator
Staff member
Local time
Yesterday, 22:27
Joined
Aug 30, 2003
Messages
36,123
I'll get out of the way.
 

Alhakeem1977

Registered User.
Local time
Today, 08:27
Joined
Jun 24, 2017
Messages
308
mid has three parameters the last is optional
mid(string,start position,number of Characters)
mid(string,7,3) start at 7 go 3 characters
without the last parameter it takes all remaining characters
mid(string,7)
Thanks a lot, I do not know how to thank you.

It's done, thank you.

Sent from my HUAWEI NXT-L29 using Tapatalk
 

Users who are viewing this thread

Top Bottom