Create a calculated field in the first empty field named Day
Create a calculated field in the first empty field named DaysOnMarket that will calculate the number of days each sold property was on the market when it sold (Hint: subtract DateListed from the DateSold field). Add a caption of Days on Market.
Solution
The questio doesnot mention the programming language to use so I will use JAVA
Here is java code
import java.util.*;
public class DateDiff
{
public static void main(String a[])
{
public class BlogEntryTester
{
public static void main(String args[]){
// Create date with 10 days of difference from selling date
java.util.Date DateListed =new java.util.Date(System.currentTimeMillis()-86400000*10);
//create selling date of today
java.util.Date DateSold =new java.util.Date();
int daysInMarket = (int)( (DateSold .getTime() - DateListed.getTime())/ (1000 * 60 * 60 * 24) );
System.out.println(daysInMarket);
}
}
