The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com




Thread: Date aritematic
View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #2 (permalink)  
Old 04-16-2007
Shell_Life's Avatar
Shell_Life Shell_Life is offline
Registered User
  
 

Join Date: Mar 2007
Location: Bahia, Brazil
Posts: 695
Spring_buck,
A true date calculation can be very involved as you have to consider leap years.
What I recommend you to do is the following:
1) Define a temp table with two datetime fields.
2) Load all your datetime fields into the table.
3) Run the following select:
SELECT datetime_from, datetime_to, datetime_to - datetime_from
FROM your_table
This solution will prove to be much quicker to implement.