You need to sign in to do that
Don't have an account?
ArmanM
Date/Time Formula field
Hi,
I am trying to add timestamp to a formula field that was a Date type field before but now I am trying to switch this to a Date/Time field. However I am getting an error after changing the formula type from Date to Date/Time.
Field Name - Completed Date
Error that I am getting - "Formula result is data type (Date), incompatible with expected data type (Date/Time). (Related field: Formula)"
Formula I am using - "IF(ISPICKVAL( Data_Status__c,"Completed" ),TODAY(), NULL)"
I tried replacing Today() function with Now() but thats giving a dynamic timestamp not the time according to the formula which says if the status is changed to 'Completed', add the date and time.
Why am getting this error ? And How can I add timestamp to this formula field using Date/Time type.
Thanks
I am trying to add timestamp to a formula field that was a Date type field before but now I am trying to switch this to a Date/Time field. However I am getting an error after changing the formula type from Date to Date/Time.
Field Name - Completed Date
Error that I am getting - "Formula result is data type (Date), incompatible with expected data type (Date/Time). (Related field: Formula)"
Formula I am using - "IF(ISPICKVAL( Data_Status__c,"Completed" ),TODAY(), NULL)"
I tried replacing Today() function with Now() but thats giving a dynamic timestamp not the time according to the formula which says if the status is changed to 'Completed', add the date and time.
Why am getting this error ? And How can I add timestamp to this formula field using Date/Time type.
Thanks
Hope this helps.
All Answers
If you formula data type is date, the formula should be IF(ISPICKVAL( Data_Status__c,"Completed" ),TODAY(), NULL)
If its date time the formula should be IF(ISPICKVAL( Data_Status__c,"Completed" ),NOW(), NULL)
I am not sure what you meant by
"I tried replacing Today() function with Now() but thats giving a dynamic timestamp not the time according to the formula which says if the status is changed to 'Completed', add the date and time. "
Can you explain bit more.
Hope this helps.
However I think the second answer by SalesFORCE_enFORCEr might end up working using workflow rule instead of the formula.