[SQL] Re: Adding an INTERVAL to a variable

2001-08-09 Thread Graham Coates
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" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > > "GC" == Gra

Re: [SQL] Re: Adding an INTERVAL to a variable

2001-08-07 Thread Josh Berkus
Graham, > GC> SELECT Invoices.InvoiceDate + INTERVAL Acct.AverageDaysToPay > 'Days' Actually, all you're missing is some punctuation. Don't skimp on the :: and () ! Plus, you should use explicit CASTs wherever you remember them: SELECT Invoices.InvoiceDate + INTERVAL(CAST(Acct.AverageDaysToPa

[SQL] Re: Adding an INTERVAL to a variable

2001-08-07 Thread Vivek Khera
> "GC" == Graham Coates <[EMAIL PROTECTED]> 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 SELE