Re: [GENERAL] subtracting from a date

2014-02-06 Thread David Johnston
jvsrvcs wrote > I tried that but get an error > v_start_date date; > v_minus_one_year date; > > I have v_start_date to start with and want to subtract one year and put > into v_minus_one_year > > select v_start_date - interval '1 yr' as v_minus_one_year; > > > > --- I get: > > ERRO

Re: [GENERAL] subtracting from a date

2014-02-06 Thread Jerry Sievers
Jay Vee writes: > I tried that but get an error > ? ? v_start_date date; > ? ? v_minus_one_year date; > > I have v_start_date to start with and want to subtract one year and put into > v_minus_one_year > ?? > ? select v_start_date - interval '1 yr' as v_minus_one_year; sj$ cat q create or repl

Re: [GENERAL] subtracting from a date

2014-02-06 Thread Jay Vee
I tried that but get an error v_start_date date; v_minus_one_year date; I have v_start_date to start with and want to subtract one year and put into v_minus_one_year select v_start_date - interval '1 yr' as v_minus_one_year; --- I get: ERROR: query has no destination for result da

Re: [GENERAL] subtracting from a date

2014-02-06 Thread Steve Crawford
On 02/06/2014 09:25 AM, Jay Vee wrote: I have reviewed working with dates documentation but some things are not clear and I cannot get an example to work for what I need. I am passing a date into a stored function like '2013-04-01' The stored function accepts this string as a date type. Withi

Re: [GENERAL] subtracting from a date

2014-02-06 Thread Adrian Klaver
On 02/06/2014 09:25 AM, Jay Vee wrote: I have reviewed working with dates documentation but some things are not clear and I cannot get an example to work for what I need. I am passing a date into a stored function like '2013-04-01' The stored function accepts this string as a date type. Within