6 Replies Latest reply: Oct 15, 2015 8:10 AM by pritesh foujdar

# To find age between two dates

Hello,

my question is for given attachment. I've two tables Opportunity and lead. In opportunity there is Closedate and CreatedDate in Lead table. I want Opportunity Close Date – Lead Creation Date  to compute Age. Can I get solution?

• ###### Re: To find age between two dates

How are the records in the Lead table related to those in the Opportunities table? What's the key to link the tables?

• ###### Re: To find age between two dates

That's the main problem which I'm facing to link those tables and get age output. but I saw something link between ConvertedOpportunityId in lead table and Id in Opportunity table.

please get the solution for this Problem.

• ###### Re: To find age between two dates

HI

you can use AGE function check it on help

or you can create bucket if(Num(Opportunity Close Date) - Num(Lead Creation Date)<=90, '3months',

If(Num(Opportunity Close Date) - Num(Lead Creation Date)>90<=180,'6 Months',

If(Num(Opportunity Close Date) - Num(Lead Creation Date)>180<=365,'1 year'))) and so on you can create the bucket.

Hope it helps you.

Regards,

Rohit

• ###### Re: To find age between two dates

That's the main problem which I'm facing to link those tables and get age output. but I saw something link between ConvertedOpportunityId in lead table and Id in Opportunity table.

please get the solution for this Problem.

• ###### Re: To find age between two dates

As Gysbert Asked earlier, I too have the same question before we can make any attempts to help you out/.

Whats the Key field which links both the tables?.

• ###### Re: To find age between two dates

That's the main problem which I'm facing to link those tables and get age output. but I saw something link between ConvertedOpportunityId in lead table and Id in Opportunity table.

please get the solution for this Problem.