Hi Goutam,
there is a designated formula just for that. it is called Date difference and you can find it in the formula editor under "Date Time" functions.
the following is from the help files:
Date Difference
Returns the difference of two datetime values. The interval argument can be Second, Minute, Hour, Day, Week, Month, Quarter, Year. The alignment arguments are described here:
Start is used to count the number of times an interval starts.
Actual is used to count whole intervals.
Fractional is used to count fractional intervals.
For example, the following formula returns 207.890243055556, the number of days between the dates:
Date Difference(01Jan2010:00:00:00, 27Jul2010:21:21:57, "Day", "fractional");
The following formula returns 207, the number of completed days between the dates:
Date Difference(01Jan2010:00:00:00, 27Jul2010:21:21:57, "Day", "actual");
The following formula returns 9, the number of completed hours between the times:
Date Difference(01Jan2010:00:00:00, 01Jan2010:09:22:57, "Hour", "actual");
The following formula returns 1, the number of times a new hour started between the times:
Date Difference(31Dec2010:23:59:59, 01Jan2011:00:59:59, "Hour", "start");
alternatively you can run the following script and pay attention to the last comand with the formula of column 3.
New Table( "Untitled",
Add Rows( 1 ),
New Column( "Column 1",
Numeric,
Continuous,
Format( "m/d/y", 12 ),
Input Format( "m/d/y" ),
Set Values( [2900620800] )
),
New Column( "Column 2",
Numeric,
Continuous,
Format( "m/d/y", 12 ),
Input Format( "m/d/y" ),
Set Values( [2900966400] )
),
New Column( "Column 3",
Numeric,
Continuous,
Format( "Best", Use thousands separator( 0 ), 17 ),
Formula( Date Difference( :Column 1, :Column 2, "day", "actual" ) )
)
);
good luck!