CREATE procedure St_Proc_GetUserReportforCurrentDayTask
@userID int
as
Begin
set NoCount on;
DECLARE @TODAY DATE
SET @TODAY = CONVERT(VARCHAR(10), GETDATE(), 111)
select CONVERT(VARCHAR,production.CalendarDate,101) + RIGHT (CONVERT(VARCHAR,production.CalendarDate , 100 ) ,7) as Date,
RegionAndProjectInfo.RegionProjectName as Region ,
County.CountyName as County,
WorkType.WorkTypeName as WorkType,
Task.TaskName as Task,
Production.VolumeProcessed as 'Volumes Processed',
Production.TimeSpent as 'Duration'
from Production
inner join RegionAndProjectInfo
on
RegionAndProjectInfo.RegionProjectID=Production.RegionProjectID
inner join County
on
County.CountyID=Production.CountyID
inner join WorkType
on
WorkType.WorkTypeID=Production.WorkTypeID
inner join Task
on
Task.TaskID=Production.TaskID
where Production.UserID=@userID and CalendarDate >= @TODAY
End
从上面的存储过程中,我正在填充一个数据集。之后,我将此数据集绑定到一个网格视图。在数据集中,列持续时间包含 HH:MM 格式的数据(example-01:00,12:45,02:59 等)。有没有办法可以从数据集本身。我不想再次从数据库中查询以获取持续时间的总和。