Re: Copy Date Value

From: Steve Cosner <stevec_at_zimmer.csufresno.edu>
Date: 1997/07/07
Message-ID: <868292855.8701_at_dejanews.com>#1/1


To use Copy with date items, you do this: COPY(name_in('block_1.date'),'block_2.date'); But you must be careful what date format mask you use. Some don't work. One that does is DD-MON-YYYY. (This topic was discussed last month. Search Dejanews for "copy" and "date" to find it.)

Steve Cosner
http://members.aol.com/stevec5088
QA: Dynamic browse & update utility form available (upgraded to version 0.7e 05-May-1997)

In article <33BBEDC9.7F03667E_at_doit.wisc.edu>,   _x_jochen.doermann_at_doit.wisc.edu wrote:
>
> I'm using Forms [32 Bit] Version 4.5.7.1.6 (Production). I have two
> date items (eff_date and end_date) on the form (they are base table
> items). I also have a series of check boxes (option_a, option_b, ...)
> and associated dates (eff_date_a, end_date_a, eff_date_b, end_date_b,
> ...). When the user clicks on the check boxes, the date should be
> cleared if the check is removed and defaulted to the overall eff_date
> and end_date when the box is checked.
>
> I've put a when_checkbox_changed trigger at the block level. It's
> supposed to either clear or default the appropriate date fields based on
> the checkbox clicked. It goes something like this
>
> declare
>
> checked_item varchar2(30);
> option_id varchar2(2);
> item_name varchar2(30);
>
> begin
>
> checked_item := :system.current_item; /* get the item name */
> option_id := substr(checked_item,8,1); /* strip off the last
> character */
>
> /* clear or default the eff date */
> item_name := 'eff_date_' || option_id; /* build a new item name */
> if name_in(checked_item) = 'Y' then
> copy(:block.eff_date, item_name); /* copy the overall eff date */
> else
> copy(null, item_name); /* clear the item */
> end_if;
>
> /* clear or default the end date */
> item_name := 'end_date_' || option_id;
> if name_in(checked_item) = 'Y' then
> copy(:block.end_date, item_name);
> else
> copy(null, item_name);
> end_if;
>
> end;
>
> The copy(null, xxx) works fine, but the other copy gives me a compile
> error.
>
> copy(:block.eff_date, item_name) --> wrong number or types of
> arguments in call to 'COPY'
>
> copy(block.eff_date, item_name) --> table reference 'BLOCK' not
> allowed in this context (table name and block name are the same)
>
> What am I doing wrong? Is there a better way?
>
> TIA -- Jochen
>
> ------
>
> Please remove the _x_ from my address if you reply by e-mail.
> Trying to avoid some of the spam. It's jochen.doermann_at_...

-------------------==== Posted via Deja News ====-----------------------
      http://www.dejanews.com/     Search, Read, Post to Usenet
Received on Mon Jul 07 1997 - 00:00:00 CEST

Original text of this message