Home » Developer & Programmer » Forms » DATE CHECKING (ORACLE FORM BUILDER 6i)
DATE CHECKING [message #335835] Wed, 23 July 2008 22:56 Go to next message
fadhzone
Messages: 61
Registered: April 2008
Member
Hi All,

anybody please help me...

a main form have a few rows.there is a date column.
the condition is if 1st row is 23-Jan-08,then the rest must in same month too.
i want write the script for the checking in when-validate-item but how?
my boss to see it this evening.

from what i know is must use cursor concept but i dont know how to do that coz i'm new in programming

Thanks.

[Updated on: Wed, 23 July 2008 23:49]

Report message to a moderator

Re: DATE CHECKING [message #335856 is a reply to message #335835] Thu, 24 July 2008 00:42 Go to previous messageGo to next message
gurupatham
Messages: 66
Registered: March 2008
Location: Chennai
Member
If all the rows in multi record block,
use the following code in the when-validate-item trigger of date field.

IF :system.cursor_record = 1 then
	:parameter.dummy := to_char(:Date_item6 , 'MM');
else
	if :parameter.dummy <> to_char(:Date_item6 , 'MM') then
		message('Month is not matched with first row');
		raise form_trigger_failure;
	end if;
end if;

Re: DATE CHECKING [message #335867 is a reply to message #335856] Thu, 24 July 2008 01:00 Go to previous messageGo to next message
fadhzone
Messages: 61
Registered: April 2008
Member
thank you so much..

i'll try the script within my form.
Re: DATE CHECKING [message #335876 is a reply to message #335835] Thu, 24 July 2008 01:14 Go to previous messageGo to next message
Littlefoot
Messages: 20896
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
I'd rather use TRUNC(:date_item, 'MM') than TO_CHAR(:date_item, 'MM') because TO_CHAR will ensure the month is the same, but the year is not.

Though, you have never said that both month and year must match.
Re: DATE CHECKING [message #335881 is a reply to message #335876] Thu, 24 July 2008 01:28 Go to previous message
fadhzone
Messages: 61
Registered: April 2008
Member
I know..but later i'll ask my boss about that..for the time moment i use trunc(:date_item, 'MM').
after i studied about cursor,the one that guru gave me the most easy.
thanks guru n littlefoot.
Previous Topic: Forms 10g Run time error
Next Topic: Forms get hanged when close calling a report
Goto Forum:
  


Current Time: Tue Dec 06 02:51:13 CST 2016

Total time taken to generate the page: 0.08723 seconds