我希望从DateDiff
返回的值格式化为HH:MM:SS.
目前,我正在使用:
=DateDiff("S",Fields!StartDate.Value,Fields!EndDate.Value).
如何修改上述表达式?
答案 0 :(得分:0)
=RIGHT("0" + CStr(DateDiff("S",Fields!StartDate.Value,Fields!EndDate.Value)/3600), 2) + ":" +
RIGHT("0" + CStr((DateDiff("S",Fields!StartDate.Value,Fields!EndDate.Value)/60) Mod 60), 2) + ":" +
RIGHT("0" + CStr(DateDiff("S",Fields!StartDate.Value,Fields!EndDate.Value) Mod 60), 2)
答案 1 :(得分:0)
修复:
=DATEDIFF("h",Fields!StartDate.Value,Fields!EndDate.Value)
& ":" & DATEDIFF("n",Fields!StartDate.Value,Fields!EndDate.Value) MOD 60
& ":" & DATEDIFF("s",Fields!StartDate.Value,Fields!EndDate.Value) MOD 60