Results 1 to 5 of 5
  1. #1
    Join Date
    Jun 2004
    Posts
    42

    Unanswered: Return Date feild

    Hi,
    i desined a form with master and detail blocks,
    in the details block i insert date and other information.
    my problem is that when doing query i need to retrieve the information that were inserted in the in the last date.
    for example if there where data inserted in the prevoius week,so we will have data for each day,i need when i run the form to retrive what was last inserted,not for the whole week.
    i need to know how to do this ,this is really urgent.

    and i have another question how can i create a log table that keep all the information and changes that the user might do on the table.

    Thanks
    Last edited by F.I.K; 07-26-04 at 05:37.

  2. #2
    Join Date
    Apr 2002
    Posts
    56
    select *
    from table
    where date = (select max(date) from table)

  3. #3
    Join Date
    Jun 2004
    Posts
    42
    thanks for the reply.

    but it didn't work ,i think there is something wrong with the place i put the code or the code itself....note the detail block display more than one record.
    i have this code that i call in the post_query trigger
    PROCEDURE get_currency_info IS
    CURSOR c1 IS SELECT
    rate_date,
    r_code,
    r_no,
    r_desc,
    rate,
    inverse_rate,
    r_decimal_digits_value
    from crm.seg_rate,crdb.a_cust_segs_n
    where rate_date = (select max(rate_date) from seg_rate)
    and crdb.a_cust_segs_n.seg_code=seg_rate.seg;
    BEGIN
    FOR c1rec IN c1 LOOP
    execute_query;
    END LOOP;
    END;

  4. #4
    Join Date
    Apr 2002
    Posts
    56
    I don't know about forms
    but this part of the cursor:

    SELECT
    rate_date,
    r_code,
    r_no,
    r_desc,
    rate,
    inverse_rate,
    r_decimal_digits_value
    from crm.seg_rate,crdb.a_cust_segs_n
    where rate_date = (select max(rate_date) from seg_rate)
    and crdb.a_cust_segs_n.seg_code=seg_rate.seg;

    should really give you all the records with the maximum rate_date.
    Have you tried to eun the query seperately (in TOAD for example) to test the results?

  5. #5
    Join Date
    Jun 2004
    Posts
    42
    thanks,it test it again and it works In Toad it returns the right data ,
    but i still have a problem when i run the form it returns the data more than one time ,and the data is repeated as many record i have in the table

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •