| От | Richard Huxton |
|---|---|
| Тема | Re: Using DateDiff with Postgres |
| Дата | |
| Msg-id | 003501c0ffe0$dc3e4700$1001a8c0@archonet.com обсуждение исходный текст |
| Ответ на | Using DateDiff with Postgres (jeff@emojo.com (Jeff Rhys-Jones)) |
| Список | pgsql-sql |
From: "Jeff Rhys-Jones" <jeff@emojo.com> > Hi there. I was wondering if anyone can tell me the correct syntax for > using DateDiff for postgrees. I'm using MI (or mi) for minute and I > keep getting attribute 'mi' not found. > > I've looked at postgres.org and can't seem to find any ref. to using > datediff. You just subtract dates with PG: select now() - CURRENT_DATE; Will return an "interval" type with the elapsed time since midnight. If you want that in seconds do: select extract(epoch from (now() - CURRENT_DATE)); Converting to minutes is obviously easy from there. I think datediff() is a MS-Access thing isn't it? - Richard Huxton
В списке pgsql-sql по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера