[SalesForce] Case Age in Hours minutes and seconds

Im trying to create a formula which shows me the Case age.
I have following formula which does the right job except its NOT showing the seconds.
I tried several ways to include the seconds but i always get error messages.

Can anybody help me and give me some hints on how to add the seconds here?

IF(
    ISPICKVAL( Status , "Open"),
    TEXT(FLOOR((NOW() -  CreatedDate) *24)) &" Hours "& TEXT( ROUND(MOD((NOW()-CreatedDate)*1440,60),0) )&" Minutes ",
    ""
)

Best Answer

Hopefully this will solve your issue:

IF(
    ISPICKVAL( Status , "Open"),
    IF(FLOOR( (NOW()- CreatedDate)) > 0,TEXT( FLOOR( (NOW()- CreatedDate)) ) & " days ", "") 
    & IF(FLOOR( MOD( (NOW()- CreatedDate)* 24, 24 ) )>0,TEXT( FLOOR( MOD( (NOW()- CreatedDate)* 24, 24 ) ) ) & " hours ","") 
    & TEXT( ROUND( MOD( (NOW()- CreatedDate)* 24 * 60, 60 ), 0 ) ) & " minutes "
    & TEXT( ROUND( MOD( (NOW()- CreatedDate)* 24 * 60*60, 60 ), 0 ) ) & " seconds", 
    ""
)

It will display the value like this:

19 days 13 hours 7 minutes 53 seconds

For more information about using formula, refer Formula Operators and Functions

Related Topic