If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Informix > Return date subtraction as fraction of days

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-16-09, 16:01
alpacapilot alpacapilot is offline
Registered User
 
Join Date: Apr 2009
Posts: 1
Return date subtraction as fraction of days

I am trying to subtract one datetime from another and return the amount of days in decimal fraction. Like 14.5 days.

One date and time is actually from two different columns so I have to put them together first. So here is what I tried.

(TO_DATE(datr || ' ' || timr, '%m/%d/%Y %H:%M') - assigned_time) as days_old

However the result comes out like this: 14 06:13:41.00000

Any help would be appreciated.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On