form values. [message #144600] |
Thu, 27 October 2005 06:29 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
Sharaf
Messages: 62 Registered: September 2005 Location: U.K
|
Member |
|
|
please i have a form with items from my table as shown below.
please i have set my default startdate initial value to sysdate.
now i want to set my enddate to the value of startdate + 21
like (enddate = startdate+21)
I dont know how to go about it.
this is my table.
create table loan(
loan_id varchar2(10),
patron_id varchar2(10),
bkcopy_id varchar2(10),
startdate date,
enddate date,
returndate date,
days_overdue number(2),
Fine_due number(6,2),
constraint pk_loan primary key (loan_id),
Regards.
|
|
|
Re: form values. [message #144723 is a reply to message #144600] |
Thu, 27 October 2005 18:37 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) |
![](/forum/images/custom_avatars/67467.jpg) |
djmartin
Messages: 10181 Registered: March 2005 Location: Surges Bay TAS Australia
|
Senior Member Account Moderator |
|
|
As you have defined a default value for startdate of sysdate, have you tried defining a defalut value for enddate of sysdate+21?
Create a When-Create-Record trigger on block that defines 'loan'. I prefer to place code likebegin
:blk.startdate := sysdate;
:blk.end_date := :blk.start_date+21;
end; instead of using default values.
David
[Updated on: Thu, 27 October 2005 18:38] Report message to a moderator
|
|
|