Extract only Date from the string I have one field in database and I am getting the multiple dates in the same field. I want to extract multiple dates from the string. Please help me on this
String like:

"7/3/2019 1:20 AM - Request submitted by Ekaterina Rahul  7/3/2019 1:34 AM - Request assigned to   7/3/2019 3:22 AM - PO123456 created"
dbfiddle

DECLARE @string VARCHAR(MAX) = '7/3/2019 1:20 AM - Request submitted by Ekaterina Rahul 7/3/2019 1:34 AM - Request assigned to 7/3/2019 3:22 AM - PO123456 created';

WITH abc(i,x,y) AS (
  SELECT 
    1 as i,
    @string as X,
    @string as Y
  UNION ALL
  SELECT 
    i+1,
    SUBSTRING(Y,1,CHARINDEX(' ',Y)),
    SUBSTRING(Y,CHARINDEX(' ',Y)+1,1024)
  from abc 
  where X&lt;&gt;'' 
  )
select TRY_CAST(CONCAT(a1.X, a2.X , a3.X) as DATETIME) ValidDate
from abc a1
inner join abc a2 on a2.i=a1.i+1
inner join abc a3 on a3.i=a1.i+2
where not TRY_CAST(CONCAT(a1.X, a2.X , a3.X) as DATETIME) is null;


output:

ValidDate
03/07/2019 01:20:00
03/07/2019 01:34:00
03/07/2019 03:22:00


Using LAG, or LEAD, example with dbfiddle does not seem to be less expensive than the INNER JOIN's. Results show almost equal times..

Below the example with LAG:

DECLARE @string VARCHAR(MAX) = '7/3/2019 1:20 AM - Request submitted by Ekaterina Rahul 7/3/2019 1:34 AM - Request assigned to 7/3/2019 3:22 AM - PO123456 created';

WITH abc(i,x,y) AS (
  SELECT 
    1 as i,
    @string as X,
    @string as Y
  UNION ALL
  SELECT 
    i+1,
    SUBSTRING(Y,1,CHARINDEX(' ',Y)),
    SUBSTRING(Y,CHARINDEX(' ',Y)+1,1024)
  from abc 
  where X&lt;&gt;'' 
  )
SELECT * FROM (
    SELECT 
        TRY_CAST(concat(lag(a1.x,2) over (order by a1.i), lag(a1.x,1) over (order by a1.i), a1.x) as DATETIME) ValidDate
    from abc a1
    ) x
where not x.ValidDate is null;