split field (1 Viewer)

kolait

Registered User.
Local time
Today, 17:27
Joined
Oct 11, 2019
Messages
60
Hello
I have a field like the one below that I want to divide into three fields. Thanks for helping me. my office is 2019
25/12/1
7/9/15
78/12/21
 

theDBguy

I’m here to help
Staff member
Local time
Today, 05:57
Joined
Oct 29, 2018
Messages
21,358
Hi kolait. If you're trying to do this in a query, as the forum title implies, then; unfortunately, you won't be able to use the Split() function directly. If you only have three elements to split, then you might be able to use a combination of the Left(), Mid(), and InStr() functions. Otherwise, you will have to create a custom function to wrap the Split() function in that you can then use in your query.
 
Last edited:

kolait

Registered User.
Local time
Today, 17:27
Joined
Oct 11, 2019
Messages
60
Hi kolait. If you're trying to do this in a query, as the forum title implies, then; unfortunately, you won't be able to use the Split() function directly. If you only have three elements to split, then you might be able to use a combination of the Left(), Mid(), and InStr() functions. Otherwise, you will have to create a custom function to wrap the Split() function in that you can use in your query.

thank you.
I just got this out. I couldn't do it for the rest
Left([feild],InStr([feild,"/")-1)
 

isladogs

MVP / VIP
Local time
Today, 12:57
Joined
Jan 14, 2017
Messages
18,186
It does exist in all versions of Office including 2019/365.
However its VBA only. it can't be used directly in a query (unless called from another function).
 

theDBguy

I’m here to help
Staff member
Local time
Today, 05:57
Joined
Oct 29, 2018
Messages
21,358
thank you.
I just got this out. I couldn't do it for the rest
Left([feild],InStr([feild,"/")-1)
Try this one:
Code:
Mid([field],InStr([field],"/")+1,InStr(Mid([field],InStr([field],"/")+1),"/")-1)
(untested)
 

kolait

Registered User.
Local time
Today, 17:27
Joined
Oct 11, 2019
Messages
60
Try this one:
Code:
Mid([field],InStr([field],"/")+1,InStr(Mid([field],InStr([field],"/")+1),"/")-1)
(untested)

thank you so much
What to do for the right?
 

kolait

Registered User.
Local time
Today, 17:27
Joined
Oct 11, 2019
Messages
60
It does exist in all versions of Office including 2019/365.
However its VBA only. it can't be used directly in a query (unless called from another function).

thank you
I wish they could be used directly in the query
 

theDBguy

I’m here to help
Staff member
Local time
Today, 05:57
Joined
Oct 29, 2018
Messages
21,358
thank you so much
What to do for the right?
Hi. I'm surprised that worked without testing. For the right, it's much easier.
Code:
Mid([field],InStrRev([field],"/")+1)
 

kolait

Registered User.
Local time
Today, 17:27
Joined
Oct 11, 2019
Messages
60
Hi. I'm surprised that worked without testing. For the right, it's much easier.
Code:
Mid([field],InStrRev([field],"/")+1)

thank you so much..
It was great..
 

isladogs

MVP / VIP
Local time
Today, 12:57
Joined
Jan 14, 2017
Messages
18,186
I tried this but it made an error

It does work. Perhaps you used it incorrectly.
Even though you have a solution, I would recommend trying it again as it is so useful.
If you still get an error please provide details / screenshots
 

kolait

Registered User.
Local time
Today, 17:27
Joined
Oct 11, 2019
Messages
60
It does work. Perhaps you used it incorrectly.
Even though you have a solution, I would recommend trying it again as it is so useful.
If you still get an error please provide details / screenshots

thank you
I managed to do it.
You and many other friends have helped me a lot. Thank you all
 

Users who are viewing this thread

Top Bottom