Compare Values

forum.sqlbase (2000-2010)
NewsgroupServer
Robot
Robot
Posts: 118939
Joined: 24 Feb 2017, 12:00
Location: World wide

Compare Values

Post by NewsgroupServer » 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

NewsgroupServer
Robot
Robot
Posts: 118939
Joined: 24 Feb 2017, 12:00
Location: World wide

Compare Values

Post by NewsgroupServer » 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)
...

NewsgroupServer
Robot
Robot
Posts: 118939
Joined: 24 Feb 2017, 12:00
Location: World wide

Compare Values

Post by NewsgroupServer » 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

NewsgroupServer
Robot
Robot
Posts: 118939
Joined: 24 Feb 2017, 12:00
Location: World wide

Compare Values

Post by NewsgroupServer » 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 [Crawler] and 0 guests