Manikannan
asked on
I have to convert the given value into the format " Days:HH:MM:SS " in SSRS report
I have to convert the value into DDD:HH:MM:SS format.
For example
if I get the value 241 , I have to convert it into 10:01:00:00
When > 24 hours, to use number of days
DDD -days
HH -Hours
MM -Minutes
SS -Seconds
How to do it in ssrs expression?!
For example
if I get the value 241 , I have to convert it into 10:01:00:00
When > 24 hours, to use number of days
DDD -days
HH -Hours
MM -Minutes
SS -Seconds
How to do it in ssrs expression?!
what is the value 241, is it minutes, days or hours or seconds? based upon that we should write the function
ASKER
Suresh,
Its minutes
Its minutes
declare @mint int /* minutes */
set @mint = 3456
Select @mint,
Cast(@mint / 1440 as Varchar) + ':' +
Cast((@mint%1440) / 60 as Varchar) + ':' +
Cast(@mint % 60 as Varchar)
set @mint = 3456
Select @mint,
Cast(@mint / 1440 as Varchar) + ':' +
Cast((@mint%1440) / 60 as Varchar) + ':' +
Cast(@mint % 60 as Varchar)
ASKER
Suresh,
I asked it in the SSRS expression , not in the sql stmt.
Is it possible to add in ssrs?!
for ex
DATEADD("n",Parameters!NoO fMinute.Va lue)
I asked it in the SSRS expression , not in the sql stmt.
Is it possible to add in ssrs?!
for ex
DATEADD("n",Parameters!NoO
yes, same logic you use it in ssrs expression by concatenating it in a expression of a text box
ASKER
How to do that suresh?!
Now in the textbox, i'm displaying the following,
=Last(Fields!I_TIME_ON_GPS .Value)
Can u tell me how to change the "I_TIME_ON_GPS.Value" value into "DDD:HH:MM:SS" format
Now in the textbox, i'm displaying the following,
=Last(Fields!I_TIME_ON_GPS
Can u tell me how to change the "I_TIME_ON_GPS.Value" value into "DDD:HH:MM:SS" format
try this in expression
CChar(Fields!I_TIME_ON_GPS .Value/144 0) + ":" + CChar((DivRem(Fields!I_TIM E_ON_GPS.V alue,1440) )/60) + ":" + CChar(DivRem(Fields!I_TIME _ON_GPS.Va lue,60)) + ":00"
the ":00" in last is for seconds, as the number is in minutes, you cannot divide them into seconds
CChar(Fields!I_TIME_ON_GPS
the ":00" in last is for seconds, as the number is in minutes, you cannot divide them into seconds
ASKER
No Suresh,
It shows the error as "wrong number of arguments" in the following part
CChar((DivRem(Fields!I_TIM E_ON_GPS.V alue,1440) )/60)
It shows the error as "wrong number of arguments" in the following part
CChar((DivRem(Fields!I_TIM
Replace DivRem(Fields!I_TIME_ON_GP S.Value,14 40) to Fields!I_TIME_ON_GPS.Value Mod 1440
and
DivRem(Fields!I_TIME_ON_GP S.Value,60 ) to Fields!I_TIME_ON_GPS.Value Mod 60
and
DivRem(Fields!I_TIME_ON_GP
ASKER
Its showing error only.
Is it working in ur side?!
Is it working in ur side?!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
It helped me partially