You need to sign in to do that
Don't have an account?

Using IF function with a date formula...
Not sure what is going on here. I have a date formula:
DATE(2009, 02, 02)
I want to make it conditional on another field. In particular if another field is 0 then I want to display a blank date. To accomplish this I added an IF funciton:
IF( Custom_Field__c = 0, '', DATE(2009, 02, 02) )
Salesforce then throws the error:
Incorrect parameter for function IF(). Expected Text, recieved Date.
Any thought? If I remove the function DATE() then it says it expected text and recieved a number...
Also, if I embed the function IF() within the DATE() function, I get the same error.
Okay, if might have something to do with the fact that you're calling in a Formula (Roll-Up Summary) field.
You might want to give this shot just for the hell of it
IF(Custom_Field__c = 0, NULL, DATE(2009,02,02))
All Answers
Okay, if might have something to do with the fact that you're calling in a Formula (Roll-Up Summary) field.
You might want to give this shot just for the hell of it
IF(Custom_Field__c = 0, NULL, DATE(2009,02,02))
Got it! Changed IF() to CASE() and shaved 100 characters. Thanks for your help!
CASE( Custom_Field__c, 0, Null, DATE(2009,02,02) )