Re: Days betwen dates

Поиск
Список
Период
Сортировка
От Andy Holman
Тема Re: Days betwen dates
Дата
Msg-id 3A5B9E45.95A8A84C@i-developit.com
обсуждение исходный текст
Ответ на Days betwen dates  (Andy Holman <info@i-developit.com>)
Список pgsql-novice
Actually I found a fix for this (kinda)
There is a function named date_part. And
you can use something like

SELECT date_part('epoch', age('2001-01-24')) / 60 / 60 /24;

I believe that was what I used, and that gives you the days.
I am working from memory at the moment, but that is close.

--Andy

Stuart Urban wrote:
>
> I do not know if Postgres has the TO_DAYS() function, but I use that one
> in MySQL.  Try something like TO_DAYS(dateone) - TO_DAYS(now());  [don't
> know if the syntax is correct, but you can probably figure it out if you
> see whether the TO_DAYS() function exists].
>
> --Stu
>
> On Tue, 9 Jan 2001, Andy Holman
> wrote:
>
> > Anyone know how I can just get the number of
> > days between dates in 2 columns in a query?
> >
> > I am using something like age('dateone', 'now')
> > currently but that returns 1 year 10 mons 14 12:53:10
> > or something of the like. I just want the days between
> > them. I am using php. Please let me know if you have
> > any ideas.
> >
> > Thanks,
> > Andy
> >

В списке pgsql-novice по дате отправления:

Предыдущее
От: "Robert B. Easter"
Дата:
Сообщение: Re: Comparison Operator problem
Следующее
От: Sandeep Joshi
Дата:
Сообщение: delete trigger function in 'C'