Unix Technical Forum

days between dates

This is a discussion on days between dates within the Informix forums, part of the Database Server Software category; --> GlacierI would like to select into a temp table the number of days between 2 dates, but that gives ...


Go Back   Unix Technical Forum > Database Server Software > Informix

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-19-2008, 07:29 PM
Bill Hamilton
 
Posts: n/a
Default days between dates


GlacierI would like to select into a temp table the number of days between 2
dates,
but that gives an INTERVAL type.
Is there anyway to get that as an INT? (in IDS 7.31)

I suppose one could use the month,day,year functions.
Is that the only way?

sending to informix-list
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-19-2008, 07:29 PM
Danny De Koster
 
Posts: n/a
Default Re: days between dates

perhaps this sql could help:

select date1 - date2
from table

hth
danny

"Bill Hamilton" <bham@finsco.com> wrote in message
news:bi5btn$1rj$1@terabinaries.xmission.com...
>
> GlacierI would like to select into a temp table the number of days between

2
> dates,
> but that gives an INTERVAL type.
> Is there anyway to get that as an INT? (in IDS 7.31)
>
> I suppose one could use the month,day,year functions.
> Is that the only way?
>
> sending to informix-list



Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-19-2008, 07:30 PM
John Carlson
 
Posts: n/a
Default Re: days between dates

On Fri, 22 Aug 2003 10:04:27 -0500, "Bill Hamilton" <bham@finsco.com>
wrote:

>
>GlacierI would like to select into a temp table the number of days between 2
>dates,
>but that gives an INTERVAL type.
>Is there anyway to get that as an INT? (in IDS 7.31)
>
>I suppose one could use the month,day,year functions.
>Is that the only way?
>


Strange . . . . .
date1=9/9/03
date2=9/13/03
both are defined as date

select (date2-date1)
from jctmp1

returns: 4

those two dates that you mentioned . . . . are they datetime instead
of date?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 08:47 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com