M
Mo
I'd like to extract data from a string variable. The data mostly looks
like this: '456 585 8975 / MSKI 105'. An added complication is that the
second part of the string does not have a consistent format. The format
of the first part is always the same.
I need to extract into two parts either side of the '/'. I can do this
easily enough, for example, to extract first part:
IIf (InStr ([NHS Number new/old],"/"), Left ([NHS Number new/old],
InStr([NHS Number new/old],"/")-1))
And the second part:
IIf (InStr ([NHS Number new/old],"/"), LTrim (Mid ([NHS Number new/old],
15)))
However, some of the data will contain only the first part of the string
('456 585 8975'), or the second (' MSKI 105') without the '/'.
I tried using the 'Format' function to do this, but with no success so
far. Can anyone help?
TIA
like this: '456 585 8975 / MSKI 105'. An added complication is that the
second part of the string does not have a consistent format. The format
of the first part is always the same.
I need to extract into two parts either side of the '/'. I can do this
easily enough, for example, to extract first part:
IIf (InStr ([NHS Number new/old],"/"), Left ([NHS Number new/old],
InStr([NHS Number new/old],"/")-1))
And the second part:
IIf (InStr ([NHS Number new/old],"/"), LTrim (Mid ([NHS Number new/old],
15)))
However, some of the data will contain only the first part of the string
('456 585 8975'), or the second (' MSKI 105') without the '/'.
I tried using the 'Format' function to do this, but with no success so
far. Can anyone help?
TIA