September 25, 2006 at 11:57 am
Is there a way in reporting services to display 1 day and 1 hour instead of 25 hours OR 1.1 days ... thanks
Moe C
September 26, 2006 at 12:02 am
The better way of handling this would be on the SQL, to retrieve the day and hours in the desired format.
Prasad Bhogadi
www.inforaise.com
September 26, 2006 at 2:33 am
DECLARE @Hours INT
SET @Hours = 25
SELECT CAST((@Hours/24) AS VARCHAR) + ' Day(s) ' + CAST ((@Hours % 24) AS VARCHAR) + ' Hour(s)' AS DateValue
Prasad Bhogadi
www.inforaise.com
September 26, 2006 at 8:42 am
Are you starting with an integer number of hours, a DATEDIFF, the DaysInterval property, or what?
IAC if you can't do this on the SQL side, as others have explained, you can of course use VB functions that would do the equivalent on the reporting side.
Is your problem that you don't know the exact expression to use? If so, if it is an integer, there is probably a more elegant StringFormat way (VB is not my thing), but this would do it:
CStr
(System.Math.Round(theInteger / 24, 0)) & " days, " & CStr(theInteger Mod 24) & " hours"
October 2, 2006 at 3:50 pm
Im using in the SQL side a datediff in hours ...
Moe C
October 2, 2006 at 9:59 pm
If you're using an integer that's a DateDiff, then the VB expression I gave you should work. No? Am I misunderstanding the question?
>L<
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply