Re: adding time to a date
Date: Fri, 17 Nov 2000 09:56:31 +0100
Message-ID: <upr91tc5r88frun1j1skafmu9qt3movqte_at_4ax.com>
On Thu, 16 Nov 2000 18:07:56 GMT, Alex Filonov <afilonov_at_pro-ns.net> wrote:
>In article <evl71tkm52nv8tfhtg3e9hfv45kjvtq9n3_at_4ax.com>,
> l.bosman_at_wanadoo.be wrote:
>> In Forms6, I'm having to field on screen:
>> first one is end_time (date in format DD/MM/YYYY HH24:MI')
>> second is supl_time (date in format HH24:MI)
>> I must add the supl_time to the end_time, so I'm doing
>> :end_time := :end_time + :supl_time
>> But the result of that operation is 'error 306: wrong number or
>> types of arguments in call to '+'
>> How to proceed to add supl_time to end_time?
>:end_time := end_time + (:supl_time - trunc(:supl_time))
>
>You can only add number to a date.
Thanks for help, it works. But it seems to have a little bug in
Forms6. Here it is.
end_time display 02/02/2000 17:00
supl_time is set to 02:00
After the computing the field end_time display 02/02/2000 00:00.
The solution is
declare
m date
begin
m := end_time + supl_time;
copy(to_char(m, 'DD/MM/YYYY HH24:MI'), :end_time);
end;
I think this bug was alreday know under forms 4.5 under the reference 397 791. It could be nice to correct it one day :)
-- Luc Bosman DEV/2000 Software Engineer Database & Network Administrator l.bosman_at_wanadoo.be ICQ 37011625 http://users.skynet.be/kobukai/ ---------------------------------------------------- | -°) (°- | | /\\ Linux the choice of the GNU generation //\ | | _\_v v_/_ | ----------------------------------------------------Received on Fri Nov 17 2000 - 09:56:31 CET