+ Start a Discussion
sfdc007sfdc007 

Formula field help needed

Hi,

I am trying to create a formula field for the below requirement for which i need help on it


I have to convert milli seconds value given to the normal time value using a formula field


I tried the below formula its working fine for hours,minutes and seconds , but not sure how to add days to it

 
MY FORMULA :

if(((Duration_Number__c /1000)<60),'0hr/ 0min /' + text( ((Duration_Number__c /1000))) +'sec',
if(and(((Duration_Number__c /1000)/60)>0,((Duration_Number__c /1000)/60)<60),'0hrs /'+
text(floor( ((Duration_Number__c /1000)/60))) +'min/'+text(mod((Duration_Number__c /1000),60))+

'secs',if(((Duration_Number__c /1000)/360)>0,text(floor( ((Duration_Number__c /1000)/3600)))+'hrs/'+
text(floor(MOD(((Duration_Number__c /1000)/60),60)))+'mins/'+	
text(mod((Duration_Number__c /1000),60))+'secs','nope')))

Kindly help me pls

Thanks in Advance
 
Alexander TsitsuraAlexander Tsitsura
Hi, maybe this is correct formula
 
TEXT(FLOOR(Duration_Number__c / (24 * 60 * 60 * 1000))) + 'days/' +
TEXT(FLOOR((MOD(Duration_Number__c, (24 * 60 * 60 * 1000))) / (60 * 60 * 1000))) + 'hr/' +
TEXT(FLOOR((MOD(Duration_Number__c, (60 * 60 * 1000))) / (60 * 1000))) + 'min/' +
TEXT(FLOOR((MOD(Duration_Number__c, (60 * 1000))) / (1000))) + 'secs'

As a common practice, if your question is answered, please choose 1 best answer. 
But you can give every answer a thumb up if that answer is helpful to you.

Thanks