There is a string I need to parse to create several columns. I am using the following statement to create the employeeID column and the Import Date column:
select Substring(rowdata, 1, 9) as 'EmployeeID',
substring (rowdata, 11, 8) as 'Import Date'
from livereqlog
Example of string to be parsed:
rowdata
123456789~20160502~Thomas
[blank]~20160701~Richardson
Example current of output:
This statement doesnt return the desired output when the first 9 characters of the rowdata column are populated with [blank]. If the EmployeeID is blank I would like to return the word 'blank' and if it is populated with a number I would like to return the number.
Example of desired output:
Thank you in advance for your assistance.
Ingrid
select Substring(rowdata, 1, 9) as 'EmployeeID',
substring (rowdata, 11, 8) as 'Import Date'
from livereqlog
Example of string to be parsed:
rowdata
123456789~20160502~Thomas
[blank]~20160701~Richardson
Example current of output:
This statement doesnt return the desired output when the first 9 characters of the rowdata column are populated with [blank]. If the EmployeeID is blank I would like to return the word 'blank' and if it is populated with a number I would like to return the number.
Example of desired output:
Thank you in advance for your assistance.
Ingrid