2つの計算列が[StartTime]
あり、[EndTime]
およびは、および列を使用した式[StartTime]
で[EndTime]
計算されます。[Week]
[Year]
[Status]
ここで、最初の2つを使用して計算された別の計算列が必要です。しかし、数式内でそれらの1つを使用しようとすると、数式にエラーが発生します。[Status]
代替手段がないので、これが機能するために本当に必要です。しかし、これも可能ですか?
ここにあなたはMr-1に行きます:
(case when [IsVOR]=(1) then 'VOR'
when [MarkedAsCompleteOn] IS NULL AND [Year]<datepart(year,getdate()) then 'Overdue'
when [MarkedAsCompleteOn] IS NULL AND [Year]>datepart(year,getdate()) then 'Not Due'
when [MarkedAsCompleteOn] IS NULL AND [Year]=datepart(year,getdate()) AND [Week]<datepart(iso_week,getdate()) then 'Overdue'
when [MarkedAsCompleteOn] IS NULL AND [Year]=datepart(year,getdate()) AND [Week]=datepart(iso_week,getdate()) then 'Due'
when [MarkedAsCompleteOn] IS NULL AND [Year]=datepart(year,getdate()) AND [Week]>datepart(iso_week,getdate()) then 'Not Due'
when [MarkedAsCompleteOn] IS NOT NULL AND [Year]<datepart(year,[MarkedAsCompleteOn]) then 'Late'
when [MarkedAsCompleteOn] IS NOT NULL AND [Year]>datepart(year,[MarkedAsCompleteOn]) then 'Early'
when [MarkedAsCompleteOn] IS NOT NULL AND [Year]=datepart(year,[MarkedAsCompleteOn]) AND [Week]<datepart(iso_week,[MarkedAsCompleteOn]) then 'Late'
when [MarkedAsCompleteOn] IS NOT NULL AND [Year]=datepart(year,[MarkedAsCompleteOn]) AND [Week]=datepart(iso_week,[MarkedAsCompleteOn]) then 'On Time'
when [MarkedAsCompleteOn] IS NOT NULL AND [MarkedAsCompleteOn]<[AllocatedTimeStart] then 'Early' end)
その最後の部分はエラーを引き起こします:
[MarkedAsCompleteOn]<[AllocatedTimeStart] then 'Early'
そして、エラーは一般的です:
- Error validating the formula for column 'Status'.