Compare Values

forum.sqlbase (1998-2010)
Thomas

Compare Values

Post by Thomas » 17 Feb 2009, 16:05

 Posted by:  Thomas 

Hi.
I need a Function to receive a return value, in dependance to two compared
values. Like @DECODE() OR @IF, but - like implemeted in Report Builder -
IF VALUE1 IS LOWER THAN ZERO RETURN VALUE2
ELSE IF VALUE1 IS EQUAL TO ZERO RETURN VALUE3
ELSE IF VALUE1 IS GREATER TO ZERO RETURN VALUE4

But I Can't find. Any Idea?

Thank you very much
Thomas

FRBhote
India
Posts: 1231
Joined: 09 Mar 2017, 05:32
Location: Hyderabad, India

Compare Values

Post by FRBhote » 18 Feb 2009, 06:38

 Posted by:  F R Bhote 

NumberIFF(nInput,number1,number2,number3)

If:

nInput 0 number3 is returned

Similarly,

StrlFF(value,string1,string2,string3)
DateIFF(nInput,date1,date2,date3)
...

Thomas

Compare Values

Post by Thomas » 19 Feb 2009, 11:31

 Posted by:  Thomas 

Sorry, if i did not explain correctly. What i meant is an Sql-Function with
same behaviour like the the functions numberiff, striff in report builder.

e,g, @NUMBERIFF() OR @STRIFF()

Thank you

Stefan Beltrame

Compare Values

Post by Stefan Beltrame » 19 Feb 2009, 21:39

 Posted by:  Stefan Beltrame 

Hi Thomas

SELECT value1, @IF(value1, @IF(@abs(value1) - value1, value2, value4),
value3) AS RESULT FROM test;

Regards
Stefan

Return to “forum.sqlbase”

Who is online

Users browsing this forum: [Ccbot] and 1 guest