I'd go a slightly different route to the other commenters and suggest creating a function that handles this logic, as it's something that you'll probably want to use in a few different queries will eventually and -- when you upgrade to newer versions of SQL Server -- have more efficient means of dealing with.
So, I'd create a function like:
CREATE OR ALTER FUNCTION dbo.DurationSplit(@Duration VARCHAR(50))
RETURNS @R TABLE ( [Days] INT, [Hours] INT, [Minutes] INT)
AS BEGIN
DECLARE @Days INT, @Hours INT, @Minutes INT;
SET @Duration = REPLACE(@Duration, 'day', '.');
SET @Duration = REPLACE(@Duration, 'hour', '|');
SET @Duration = REPLACE(@Duration, 'minute', '');
SET @Minutes = CAST(
SUBSTRING(@Duration, 0, CHARINDEX('|', @Duration, 0))
AS INT);
SET @Duration = SUBSTRING(@Duration, CHARINDEX('|', @Duration, 0)+1, 50);
SET @Hours = CAST(
SUBSTRING(@Duration, 0, CHARINDEX('.', @Duration, 0))
AS INT);
SET @Duration = SUBSTRING(@Duration, CHARINDEX('.', @Duration, 0)+1, 50);
SET @Days = CAST(@Duration AS INT);
INSERT @R ([Days], [Hours], [Minutes])
VALUES (@Days, @Hours, @Minutes);
RETURN;
END
GO
which then you can include in your queries like so:
CREATE TABLE #Data (
Duration VARCHAR(50)
);
INSERT #Data (Duration) VALUES ('minute45hour1day0'), ('minute8hour10day2'), ('minute15hour2day11');
SELECT *
FROM #Data d
CROSS APPLY dbo.DurationSplit(d.Duration);