+ Start a Discussion

Help With Account Created Date

I am trying to set up an Account field validation rule that requires all accounts created after 06/01/2007  have an address in order to save the record.
The logic I am using is as follows:
And (
     CreatedDate > DATEVALUE("2007-06-01"),
  LEN(  BillingStreet  ) = 0,
  LEN(  BillingCity ) = 0,
  LEN(  BillingState  ) = 0
The problem is whenever I reference the "CreatedDate" field I get the following error:  Error: Incorrect parameter for function >(). Expected DateTime, received Date.  If I change this to another date based field on the account object there is no error. 
I appears I am doing something wrong as it pertains to the "CreatedDate" field.  Anyone have any insight?
Todd B.
Hi Todd,
The trick is that CreatedDate is in fact a datetime field, so you need to use the DATEVALUE() function on it to convert it to a date before you compare it with another date field.

Try this syntax:
     DATEVALUE(CreatedDate) > DATEVALUE("2007-06-01"),
  LEN(  BillingStreet  ) = 0,
  LEN(  BillingCity ) = 0,
  LEN(  BillingState  ) = 0

Thanks Eric,
Your solution work.  That was driving me crazy.  I must have spend two hours trying to adjust everything to the right of the > sign.  I never thought to manipulate the "CreatedDate" field!
I owe you one.  :smileyvery-happy:
Todd B.