1

I have two date fields i need to compare two date field for different conditions like if date1=date2 "ontime" , This is for reporting purpose . Note it should compare only dates not time

Thank you inadvance

1
  • Hi sai, welcome to SFSE! Please take the time to visit the Help center and read How do I ask a good question. If you post what you've written so far and where you're stuck, I'm confident you'll find plenty of people willing to assist you. SFSE is a Q&A forum where we look to help each other by asking and answering questions about real problems or errors with our code. Posting requests to write code for you generally get closed.
    – crmprogdev
    Commented Jun 1, 2016 at 18:30

2 Answers 2

1

It is not very clear what you are requesting but if what you want is to compare if two CreatedDate fields are equal in a formula you can do something like this:

IF(CreatedDate == Parent.CreatedDate, 'On time', 'Not On Time')

I used the Account CreatedDate and the Parent.CreatesDate for this example but you need to add your own fields there. This formula works, so if this is what you are looking for I hope it helps. Remember that when creating a field for this formula you need to select a text formula type.

Maybe you can start with this document to help you understand a bit better formulas. A Introduction to Formulas

2
  • IF((DATEVALUE( Committed_Shipdate_rpt__c ) >= DATEVALUE(Ship_date_rpt__c )) ,"ON Time" , "Late") -- this is formula field, it should compare date , when I report it should pass correct values
    – sai
    Commented Jun 1, 2016 at 21:10
  • I got the solution and refer to this link for more information resources.docs.salesforce.com/202/6/en-us/sfdc/pdf/…
    – sai
    Commented Jun 1, 2016 at 21:39
0

IF((DATEVALUE(Text(Committed_Shipdate_rpt__c)) >= DATEVALUE(Text(Ship_date_rpt__c) )) ,"ON Time" , "Late")

1
  • If you could add some text explaining why this solution worked for you, your answer would be a much more useful contribution to the community.
    – Adrian Larson
    Commented Jun 1, 2016 at 23:00

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