Home » Developer & Programmer » Forms » where is error (if)
where is error [message #457276] Sat, 22 May 2010 15:36 Go to next message
farooq112
Messages: 90
Registered: September 2006
Location: cairo
Member
hi everyone in this forum

i have form

i used if but the code never give me true answer

please check button qurater and my attrache
  • Attachment: IRAQ.fmb
    (Size: 48.00KB, Downloaded 990 times)
Re: where is error [message #457277 is a reply to message #457276] Sat, 22 May 2010 15:44 Go to previous messageGo to next message
Littlefoot
Messages: 21818
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Why wouldn't you rather post trigger code? I, for example, don't have Forms installation here and can't see anything.
Re: where is error [message #457334 is a reply to message #457277] Sun, 23 May 2010 23:55 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Tell us which part doesn't work. Tell us what you expected and what you are being presented. THEN we will help YOU solve YOUR problem.

David
Re: where is error [message #457355 is a reply to message #457334] Mon, 24 May 2010 01:31 Go to previous messageGo to next message
Littlefoot
Messages: 21818
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
OK then, this is the code:
BEGIN
   IF :DATE_SAL BETWEEN '01/01/2000' AND '31/03/2000'
   THEN
      :QUARTER_SAL := 1;
   ELSE
      IF :DATE_SAL BETWEEN '01/04/2000' AND '30/06/2000'
      THEN
         :QUARTER_SAL := 2;
      ELSE
         IF :DATE_SAL BETWEEN '01/07/2000' AND '30/10/2000'
         THEN
            :QUARTER_SAL := 3;
         ELSE
            IF :DATE_SAL BETWEEN '01/11/2000' AND '30/12/2000'
            THEN
               :QUARTER_SAL := 4;
            END IF;
         END IF;
      END IF;
   END IF;
END;

I suppose that ":date_sal" is a DATE datatype item. You are comparing it with strings. '01/04/2000' is a string, not a date. Perhaps you should use TO_DATE function, such as
IF :DATE_SAL BETWEEN to_date('01/04/2000', 'dd/mm/yyyy') AND
                     to_date('30/06/2000', 'dd/mm/yyyy')
THEN
   ...


If those strings were, however, correctly recognized as dates, perhaps :date_sal's value was never between values you used in IF. As you didn't anticipate such an option, well, perhaps you should.
Re: where is error [message #457356 is a reply to message #457355] Mon, 24 May 2010 01:33 Go to previous message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
How about using 'message;pause;' pairs to display the contents of ':DATE_SAL'.

David
Previous Topic: RUN_REPORT_OBJECT issue on Forms 10g
Next Topic: Enter-Query mode - one item in a block is not getting cleared
Goto Forum:
  


Current Time: Fri Sep 20 00:44:48 CDT 2024