where is error [message #457276] |
Sat, 22 May 2010 15:36 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
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 1004 times)
|
|
|
|
|
Re: where is error [message #457355 is a reply to message #457334] |
Mon, 24 May 2010 01:31 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
![](/forum/images/custom_avatars/72104.gif) |
Littlefoot
Messages: 21823 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 Go to previous message](/forum/theme/orafaq/images/up.png) |
![](/forum/images/custom_avatars/67467.jpg) |
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
|
|
|