Home » Developer & Programmer » Forms » Date increament in Details form (6i)
Date increament in Details form [message #537652] Fri, 30 December 2011 00:47 Go to next message
glmjoy
Messages: 187
Registered: September 2011
Location: KR
Senior Member
I have a problem I am making a rooster I want to increament dates. User will put input the first date then it have to increamented by user click i used Key_Next_item on Date Field.

if System.cursor_record >1 then
Doctor_Rooster_Details.Week_Date =:Doctor_Rooster_Details.Week_Date +1
Its gives me error on KeyNext_ITem of ORA

I have fields

Week_Date Day St_Time EndTime Available
01/02/2011 Friday 10:00 12:15 Y

I want to increatement Week_date when user click on next record it will incremented. ST_Time, End_Time and avilable user will input that.

01/02/2011 Friday 10:00 12:15 Y

02/02/2011 Sat
Re: Date increament in Details form [message #537668 is a reply to message #537652] Fri, 30 December 2011 02:50 Go to previous messageGo to next message
Littlefoot
Messages: 21818
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
It is difficult to debug code you don't see. Posting some fragments of both code and information is useless. What does
Quote:
Its gives me error on KeyNext_ITem of ORA
mean? Which ORA? How much would it cost if you actually copy/paste your code as well as the whole error message? How are these "date" items defined? What is their datatype?

Because, generally speaking, "date_value + 1" will return a day after the "date_value" so you must have done something wrong.
Re: Date increament in Details form [message #537685 is a reply to message #537668] Fri, 30 December 2011 04:01 Go to previous messageGo to next message
glmjoy
Messages: 187
Registered: September 2011
Location: KR
Senior Member
That is my Code on Key_Next_Item

:DOCTOR_ROOSTER_DETAILS.Week_date := :System.Cursor_Record;
It says ORA-01840 may be problem of date format but i am not getting that problem

if I write code

:DOCTOR_ROOSTER_DETAILS.Week_date +1 := :System.Cursor_Record;

I have attached the jpeg.


Thats my Details Table
DR_CODE NOT NULL CHAR(5)
ON_LEAVE CHAR(1)
WEEK_DATE NOT NULL DATE
DAY VARCHAR2(10)
ST_TIME DATE
END_TIME DATE
AVAILABLE CHAR(1)


Thats my Header Table

DR_CODE NOT NULL CHAR(5)
DR_NAME VARCHAR2(50)
SPEC_CODE CHAR(5)
CONTACT_NO1 VARCHAR2(25)
CONTACT_NO2 VARCHAR2(25)
ADDRESS VARCHAR2(70)
OPD_CHARGES NUMBER(9,2)
GENERAL_WARD_CHARGES NUMBER(9,2)
  • Attachment: error.JPG
    (Size: 77.35KB, Downloaded 639 times)
Re: Date increament in Details form [message #537704 is a reply to message #537685] Fri, 30 December 2011 05:55 Go to previous messageGo to next message
Littlefoot
Messages: 21818
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
WEEK_DATE table column is a DATE.

:SYSTEM.CURSOR_RECORD is a CHARACTER.

So, how do you plan to put '1' into a DATE column?

It appears that WEEK_DATE datatype should be NUMBER, so you'd
:DOCTOR_ROOSTER_DETAILS.Week_date := to_number(:System.Cursor_Record);
(although implicit conversion would most probably do the job).

By the way,
:DOCTOR_ROOSTER_DETAILS.Week_date +1 := :System.Cursor_Record;
is a nonsense.
Re: Date increament in Details form [message #537709 is a reply to message #537704] Fri, 30 December 2011 06:10 Go to previous message
glmjoy
Messages: 187
Registered: September 2011
Location: KR
Senior Member
Thanks a lot Little foot
Previous Topic: How To insert Column values into text items?
Next Topic: Multiple items selection in a list item
Goto Forum:
  


Current Time: Sun Sep 08 07:29:05 CDT 2024