March 27, 2006 at 11:39 am
I am trying to convert hours to days inside reporting services ... so in my report it displays 25 hours... which the user wants to see 1.1 days... can anyone help... thanks
Moe C
March 28, 2006 at 5:49 am
Moe,
I don't know if this is what you are looking for but here is what I use.
In VS.Net on data tab....
CONVERT(numeric(9, 2), dbo.Table.Field / 8) AS Days
Hope that helps,
Kerrie
March 28, 2006 at 6:43 am
Try this as your field expression:
=((Fields!hours.Value-Fields!hours.Value Mod 24) / 24) + (Fields!hours.Value Mod 24)/10
Changing the field name as appropriate, obviously
March 28, 2006 at 6:49 am
Sorry just realised the above won't work for all values, will post back when I've worked it out
March 28, 2006 at 6:54 am
Try this instead:
=(Fields!hours.Value-Fields!hours.Value Mod 24)/24 & "." & (Fields!hours.Value Mod 24)
March 28, 2006 at 10:42 am
thanks... i will use this and see what happens...
Moe C
March 28, 2006 at 3:38 pm
I tried the solution above and sorry it does not come up with it correctly... so in my SP i have 2 dates i do a datediff on ... i call it totaltime ... well then i have to take the difference between that time and divide it by the number of application came in between the time period to get the average time... so say the average time it took was 25 hours... well they customer wants to see instead of 25 hours on the report they want to see 1 day 1 hours...
Moe C
March 29, 2006 at 1:03 am
Only a slight modification of my previous code required then:
=(Fields!hours.Value-Fields!hours.Value Mod 24)/24 & " days " & (Fields!hours.Value Mod 24) & " hours "
should do it.
April 17, 2006 at 11:03 am
here is a sample from my code
=IIF(Fields!TotalApplications.Value = 0,"-",IIF(Fields!TotalReturnTime.Value / Fields!TotalApplications.Value = 0,"-",Format(Fields!TotalReturnTime.Value / Fields!TotalApplications.Value,"N1")& " days" ) )
but the problem i am running into is when when the its 25 hours.. it should display 1 day 1 hour... so the above would not work...
Moe C
Viewing 9 posts - 1 through 8 (of 8 total)
You must be logged in to reply to this topic. Login to reply