我从日历扩展器存储日期时间并将其存储在数据库中。日期时间的格式是Format="dddd, MMMM dd, yyyy"
. 然后我在网格视图中将此日期时间与其他字段一起显示,并将此字段命名为“日历日期”。目前,网格中的 CalendarDate 显示为"6/29/2012 10:42:35 AM"
.
我希望日历日期将显示如下日期:-“6/29/2012 10:42 AM”。只会删除几秒钟。请告诉我我是如何做到的。
我现在使用的存储过程是这样的:-
Create procedure St_Proc_GetUserReportforCurrentDayTask
@userID int
as
Begin
set NoCount on;
DECLARE @TODAY DATE
SET @TODAY = CONVERT(VARCHAR(10), GETDATE(), 111)
select Production.CalendarDate 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 (HH:MM)'
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