Date Initial Value [message #451075] |
Mon, 12 April 2010 05:45 |
nemises42
Messages: 2 Registered: April 2010
|
Junior Member |
|
|
Hi,
I have a two date fields in my form; valid from date and expiry date.
Currently my valid from date has an inital value property of $$date$$ which automaitcally brings up todays date.
I need my expiry date to automatically show a date 15 years after this date? Can anyone help?
Thanks in advance.
|
|
|
|
|
|
Re: Date Initial Value [message #451093 is a reply to message #451075] |
Mon, 12 April 2010 07:16 |
nemises42
Messages: 2 Registered: April 2010
|
Junior Member |
|
|
Hi,
Sorry. Do you know exactly how it works.
Do I just simply type add_months(sysdate,1).
When i type this I get error (Encountered the symbol END).
Thanks
|
|
|
|
|
Re: Date Initial Value [message #451378 is a reply to message #451093] |
Wed, 14 April 2010 04:36 |
sinida1984
Messages: 83 Registered: September 2007 Location: India
|
Member |
|
|
Hi
Please take the result into a variable.Add_months() is a date function. So the result should be stored in a variable.
Example...
declare
result_dt date;
begin
result_dt := add_months(sysdate,(15*12));
end;
Thanks
Sinida
|
|
|
Re: Date Initial Value [message #451382 is a reply to message #451378] |
Wed, 14 April 2010 04:47 |
|
Littlefoot
Messages: 21818 Registered: June 2005 Location: Croatia, Europe
|
Senior Member Account Moderator |
|
|
Right; only, as it is Forms and item's initial values we are talking about, your "variable" is, actually, an item.
:some_block.date_item := add_months(sysdate, 15 * 12); TRUNC might also be needed (depending on requirements).
|
|
|