Re: Adding an INTERVAL to a variable

Поиск
Список
Период
Сортировка
От Graham Coates
Тема Re: Adding an INTERVAL to a variable
Дата
Msg-id 9ktddf$134e$1@news.tht.net
обсуждение исходный текст
Ответ на Re: Adding an INTERVAL to a variable  (Vivek Khera <khera@kcilink.com>)
Список pgsql-sql
Thanks for the inspiration Vivek!
Didn't quite work, but when I made it...
dSalesHdrDateDue + (iAcctPayDaysAv || 'Days')::INTERVAL

BINGO! it works.
Happiness is :-)

Graham Coates


"Vivek Khera" <khera@kcilink.com> wrote in message
news:x73d737w54.fsf@onceler.kciLink.com...
> >>>>> "GC" == Graham Coates <graham@mindvision.com.au> writes:
>
> GC> SELECT Invoices.InvoiceDate + INTERVAL '41 Days'
> GC> works fine
> GC> but when trying to substitute the number of days with a value form a
field
> GC> e.g.
>
> GC> SELECT Invoices.InvoiceDate + INTERVAL Acct.AverageDaysToPay 'Days'
>
> try
>
>  SELECT Invoices.InvoiceDate + Acct.AverageDaysToPay::interval
>
>
>
> --
> =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
> Vivek Khera, Ph.D.                Khera Communications, Inc.
> Internet: khera@kciLink.com       Rockville, MD       +1-240-453-8497
> AIM: vivekkhera Y!: vivek_khera   http://www.khera.org/~vivek/




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

Предыдущее
От: Carolyn Lu Wong
Дата:
Сообщение: what does this error mean?
Следующее
От: Tom Lane
Дата:
Сообщение: Re: what does this error mean?