troubleshooting Question

DateDiff issue on a generated field

Avatar of BobRosas
BobRosas asked on
Microsoft SQL Server 2008SSRS
8 Comments1 Solution249 ViewsLast Modified:
I have the attached code as part of my query and it gives me the Hours and Minutes an employee was on break if they went over 15 minutes.  This part works.  Now I need to add another field on the report that just shows the amount they are over.  For example the HrMin field may show 0:18 for HrMin (or how long they were on break) and now I want a column to show how much of that was over the allowed amount (15 minutes).  I added a column with the following expression (instead of adding it to the query) but get an error...
   =IIf( Fields!Type.Value = "Break", DateDiff("nn", Fields!HrMin.Value, 15), 0)
Is it a format issue?  Please show me how to fix this.
convert(varchar,datediff(hh,0,(dateadd(ss,sum(ts_seconds) ,0))))+ 
	     substring((convert(varchar(8),(dateadd(ss,sum(ts_seconds) ,0)),114)),3,3) as HrsMin,
Join our community to see this answer!
Unlock 1 Answer and 8 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 8 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros