I have an expression that I just want it to show blank/nothing if it's negative from a ROUND function. Is this possible?
ROUND(IIF(a<b,"",4.2))
In my Test, if a > b, I get 4 rounded and that's great but if a<b, it shows an error. I understand it's because you can not round blank/nothing but is there a way around this? I can put a value like 0 but I really want it to show nothing.
---------------------------------------
VS2010 / ASP.NET 4 / SQL 2008 / VB.Net
Be kind to the newbies because you were there once.
Ashutosh Pathak
Blog: http://catchcode.blogspot.com Please mark it as answer if it helps, as clicking on the button can save time of others :)
MCP,MCAD,MCSD,MCTS
Marked as answer by pvong on Jan 18, 2013 02:06 PM
pvong
Member
47 Points
39 Posts
ROUND function to show blank
Nov 27, 2012 08:29 PM|LINK
I have an expression that I just want it to show blank/nothing if it's negative from a ROUND function. Is this possible?
ROUND(IIF(a<b,"",4.2))
In my Test, if a > b, I get 4 rounded and that's great but if a<b, it shows an error. I understand it's because you can not round blank/nothing but is there a way around this? I can put a value like 0 but I really want it to show nothing.
VS2010 / ASP.NET 4 / SQL 2008 / VB.Net
Be kind to the newbies because you were there once.
knieriemrt
Member
48 Points
16 Posts
Re: ROUND function to show blank
Nov 27, 2012 08:55 PM|LINK
Can you wrap it in another IIF and compare it to zero and if it is equal then make it blank, otherwise make it the value of the round?
IIF(ROUND(IIF(a<b,0,4.2))=0,"",ROUND(IIF(a<b,0,4.2)))
oned_gk
All-Star
31335 Points
6403 Posts
Re: ROUND function to show blank
Nov 28, 2012 12:21 AM|LINK
Ashutosh Pat...
Contributor
5737 Points
1105 Posts
Re: ROUND function to show blank
Nov 28, 2012 04:51 AM|LINK
use:
Blog: http://catchcode.blogspot.com
Please mark it as answer if it helps, as clicking on the button can save time of others :)
MCP,MCAD,MCSD,MCTS