您好,在下面的查询中,我面临“传递给 LEFT 或 SUBSTRING 函数的长度参数无效”的问题。您能否帮我解决这个错误,以便我可以处理查询。
select
substring(
a.ProcessInstanceDescription,
charindex('http://', a.ProcessInstanceDescription ),
charindex('KeyInstr', a.ProcessInstanceDescription )
- charindex('http://', a.ProcessInstanceDescription )),
c.StreamName AS Category,
ProcessInstanceAppianID as jobId,
a.ProcessInstanceName,
a.ProcessInstanceTargetDate AS TargetDate,
a.ProcessInstanceDescription as TaskDescription,
b.Name as department,
SUBSTRING(
ProcessInstanceName,
NULLIF(
PATINDEX('%[0-9][0-9][0-9][0-9][0-9]%',ProcessInstanceName),
0),
7) as code
from
InternalUseOnly..ProcessInstance a
join InternalUseOnly..Departments b
on b.KeyDepartment = a.KeyDepartmentEntered
AND b.updoperation < 2
join InternalUseOnly..ProcessStream c
on c.KeyProcessStream = a.KeyProcessStream
and c.updoperation < 2
where
ProcessInstanceCompleted is null
and a.KeyProcessStream in (330)
and a.updoperation < 2
我在上面附上了一张图片。我只想从任务描述中获取 URL。您能否更正此查询或给我一个确切的查询以执行相同的操作