LPW LPW 21.5: Last Paster Wins

Status
Not open for further replies.

Tribs

Well-Known Member
Joined
Mar 29, 2020
Messages
8,974
Location
Centurion
I have a string in the following format:
12346789/2/2021

I would like to extract the number before the first slash. :)
Why not just use the Left function? =Left(the cell containing the text, find("/", the cell containing the text, 1)-1)
 

Lara

Well-Known Member
Joined
Jan 23, 2021
Messages
1,659
SELECT LEFT('123456789/2/21', INSTR(1,'123456789/2/21','/') -1)
When I specify the the start position for InStr it returns an error.

Swift412 helped me on another forum. :)
 

Lara

Well-Known Member
Joined
Jan 23, 2021
Messages
1,659
Why not just use the Left function? =Left(the cell containing the text, find("/", the cell containing the text, 1)-1)
The number differs in length. Cant use Right either because the month differs in length too. :)

ps. Access doesn't have a Find function.
 

Nicholas

Well-Known Member
Joined
Jun 23, 2020
Messages
6,463
Location
East London
The number differs in length. Cant use Right either because the month differs in length too. :)

ps. Access doesn't have a Find function.
Send these non-conforming bits of string back, and insist on having all of your string cut to a standard length.
 

Lara

Well-Known Member
Joined
Jan 23, 2021
Messages
1,659
Before I go completely overboard I'll stop pasting for now. Ciao everybody and sleep well. :)
 
Status
Not open for further replies.
Top