0

Hi I am making a validation rule to check if a billing date end is earlier than the billing date start. My syntax appears to be wrong however.

My current validation formula:

DATEVALUE(Billing_Period_Start__c) > DATEVALUE(Billing_Period_End__c)

Error: Incorrect argument type for function 'DATEVALUE()'.

Fixed by removing DATEVALUE from the validation formula.

4
  • Why are you using Datevalue function? just put a simple comparison if both fields are date or datetime.
    – Mahmood
    Nov 20, 2018 at 9:07
  • 1
    What are the field value type? are your fields, Billing_Period_Start__c and Billing_Period_End__c of type date?
    – Mahmood
    Nov 20, 2018 at 9:10
  • They are both dates. I fixed the problem, I just removed datevalue from the validation rule. Nov 20, 2018 at 9:12
  • 1
    @Mahmood please post as answer to close the issue out. :)
    – Adrian Larson
    Nov 20, 2018 at 14:49

1 Answer 1

1

It seems that your fields Billing_Period_Start__c and Billing_Period_End__c are of type Date, hence the error. Remove the DATEVALUE() function from your formula and you should be good to go.

As mentioned in the DATEVALUE() function documentation

DATEVALUE() - Returns a date value for a date/time or text expression.

Its worth noting and reading the tips section of the article given above, out of which, two are related to your issue

tips

  • If the field referenced in the function is not a valid text or date/time field, the formula field displays #ERROR!
  • When entering a date, surround the date with quotes and use the following format: YYYY-MM-DD, that is, a four-digit year, two-digit month, and two-digit day.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .