Re:

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re:
Дата
Msg-id 27965.1050247815@sss.pgh.pa.us
обсуждение исходный текст
Ответ на ...  (apratim sharma <hiapra@yahoo.com>)
Список pgsql-jdbc
apratim sharma <hiapra@yahoo.com> writes:
> hi, Can anybody tell how to add an integer to a date inside postgres
> query. i'm using postgres 7.3 when i give    select cast(now() as
> date) it gives the current date, now i want to select a date say after
> 10 days. i'm giving select cast(now() as date) +10 ; it gives error
> can't typecast date to int what to do??? please help me Apratim

Works for me:

regression=# select cast(now() as date) +10 ;
  ?column?
------------
 2003-04-23
(1 row)

What PG version are you using, and are you sure that's exactly the
query you're issuing?

            regards, tom lane


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

Предыдущее
От: marian
Дата:
Сообщение: Getting the real column name.
Следующее
От: "iran"
Дата:
Сообщение: Need solution to decode data from bytea field