Home » Developer & Programmer » Forms » update column from previous row's column in Form (Merged 3)
update column from previous row's column in Form (Merged 3) [message #332368] Tue, 08 July 2008 06:20 Go to next message
khamkha
Messages: 22
Registered: May 2006
Junior Member

Dear Members,

I'm in trouble during my form creation........
I have following fileds in the table and also making form on it for data entry:-

create table poluse
(V_REG_NO VARCHAR2(12),
START_DATE DATE,
START_TIME NUMBER(4),
MTR_START_RD NUMBER(12),
END_TIME NUMBER(4),
MTR_END_RD NUMBER(12),
FINAL_TIME NUMBER(4),
MPKM_USE NUMBER(12),
BRIEF VARCHAR2(100),
OFFICIAL_PVT VARCHAR2(12),
OFFICER_NAME VARCHAR2(25))

probulms:-
1. what type of data type for start_time and end_time fileds?
0730 am to 1030 am and auto difference save in total_time how?

2. USING FORM, When I enter data in MTR_END_RD field last reading then auto difference of start reading (MTR_START_RD)store in MPKM_USE killometer useing field. How its posible

3. USING FORM, When I enter data for the Second record or third or fourth record then previous record field MTR_END__RD end reading is automatically store in the filed MTR_START_RD as a start reading. I enter only end reading... and so on for new record entery on FORMs.... How i get old previous record filed data and store in the form?

PLEASE HELP ME WITH THANKS
WITH BEST REGARDS
Mr. Kiani
How update (sum) Field on FORM automatically from Previous record [message #332373 is a reply to message #332368] Tue, 08 July 2008 06:47 Go to previous messageGo to next message
khamkha
Messages: 22
Registered: May 2006
Junior Member

Dear Members,

Following the table in database and I am using FORM for Data entry...... When enter POL issued Quantity field its same in POL ISSU UPTO field and when ever enter other record 2nd 3rd and so on.... Field POL ISSU UPTO isautomatically sums all previous record and current record data of POL_ISSU_QTY Filed...
How its posible in FORM Level.........

create table polissu
(v_reg_no varchar2(12),
pol_issu_date date,
pol_req_no varchar2(10),
pol_issu_qty number(4),
pol_issu_upto number(4))

PLEASE HELP ME WITH THANKS
Mr. Khamkha (Kiani) Sad
UPDATE COLUMN FROM PREVIOUS ROW'S COLUMN IN FORM [message #332464 is a reply to message #332368] Tue, 08 July 2008 10:48 Go to previous messageGo to next message
khamkha
Messages: 22
Registered: May 2006
Junior Member

I have some problem, may be not clearly define......I have data in the following format and create a table and update though same shape in FORM....

Enter SR-NO (1), DATE, START-TIME, START-READING, END-TIME & END-READING THEN TOTAL-TIME and TOTAL-READING must Automatically Calculate, and when enter SR-NO (2) ROW then enter SR-NO, DATE, and START-READING is automatically ENTER from previous ROW field/column END-READING because of START-READING is always same as the LAST RECORD/ROW END-READING.... HOW it is possible in FORM...... PLEASE HELP ME WITH THANKS.......

SR-NO  DATE   START-TIME  START-READING  END-TIME  END-READING  TOTAL-TIME  TOTAL-READING
  1   2-2-08     0830        100           1010       170         1H 40M         70
  2   2-2-08     1030        170           1340       280         3H 10M        110      
  3   2-2-08     1400        280           1530       310         1H 30M         50
  4   3-2-08     0830        310           1030       410         2H            100
  5   3-2-08     1230        410           1530       620         3H            210

BEST REGARDS
KHAMKHA (KIANI)

[Mod-Edit: Frank added code-tags and changed topic title]
  • Attachment: POL.JPG
    (Size: 38.04KB, Downloaded 97 times)

[Updated on: Tue, 08 July 2008 15:03] by Moderator

Report message to a moderator

Re: UPDATE COLUMN FROM PREVIOUS ROW'S COLUMN IN FORM [message #332509 is a reply to message #332464] Tue, 08 July 2008 15:02 Go to previous messageGo to next message
Frank
Messages: 7880
Registered: March 2000
Senior Member
Please do not start a new topic over and over.
Merged 3.
Re: UPDATE COLUMN FROM PREVIOUS ROW'S COLUMN IN FORM [message #338743 is a reply to message #332464] Tue, 05 August 2008 20:45 Go to previous messageGo to next message
djmartin
Messages: 10180
Registered: March 2005
Location: Canberra ACT Australia
Senior Member
Account Moderator
Have you solved your problem yet?

David
Re: UPDATE COLUMN FROM PREVIOUS ROW'S COLUMN IN FORM [message #349310 is a reply to message #338743] Fri, 19 September 2008 18:42 Go to previous messageGo to next message
khamkha
Messages: 22
Registered: May 2006
Junior Member

NO DEAR MY PROBLUM IS STILL NOT SOLVED.....I AM STILL WAITING FOR HELP..... IF ANY BODY SOVE MY PROBLUM, I'M THANKFULL....

BEST REGARDS AND WISHES..
Re: update column from previous row's column in Form (Merged 3) [message #349323 is a reply to message #332368] Sat, 20 September 2008 01:56 Go to previous messageGo to next message
Littlefoot
Messages: 20895
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Quote:
1. what type of data type for start_time and end_time fileds? 0730 am to 1030 am and auto difference save in total_time how?

Use the DATE datatype. Difference can be calculated by subtracting values; you'll, though, get number of days so you'll have to recalculate them into hours and minutes (if you don't know how to do that, do the search by yourself).

Quote:
2. USING FORM, When I enter data in MTR_END_RD field last reading then auto difference of start reading (MTR_START_RD) store in MPKM_USE killometer useing field. How its posible

Another simple subtracting; MPKM_USE = MTR_END_RD - MTR_START_RD.

Quote:
3. USING FORM, When I enter data for the Second record or third or fourth record then previous record field MTR_END__RD end reading is automatically store in the filed MTR_START_RD as a start reading. I enter only end reading... and so on for new record entery on FORMs.... How i get old previous record filed data and store in the form?

You could store value of the current record into a global variable which would then be used in the next record (see how WHEN-CREATE-RECORD and WHEN-NEW-RECORD-INSTANCE triggers behave). You'd have to initialize the global variable at the very beginning (check WHEN-NEW-FORM-INSTANCE and PRE-FORM triggers) because otherwise - for the first record - global variable's value would be unknown. Search Forms Online Help System for "global variables" and read all related topics.

And - please, do not type the whole message using capital letters.
Re: update column from previous row's column in Form (Merged 3) [message #349339 is a reply to message #349323] Sat, 20 September 2008 07:37 Go to previous message
khamkha
Messages: 22
Registered: May 2006
Junior Member

Dear, Thanks Thanks, for helping me... I'm trying to solve my problum with thanks.....Best Regards and wishes...
Previous Topic: Vista Webutil_host.host error WUH-407 Output Sink is null
Next Topic: LOV EXECUTION
Goto Forum:
  


Current Time: Mon Dec 05 19:04:41 CST 2016

Total time taken to generate the page: 0.05440 seconds