Looking for an IIFEMPTY command

  • Hi everyone,

    This is my first post, but we moved from Fox Pro to MS Reporting Services VERY recently and we are needing a command in Reporting Services just like or similar to the IIF EMPTY command that we used daily in Fox Pro?

     

  • I don't know foxpro, but are you looking for this t-SQL function?

    ISNULL ( check_expression , replacement_value )

  • Other possibilities to look at would be COALESCE in T-SQL, or IIF in VB.Net, using it to test for an empty condition.

    Note that the Report Designer does not expose very much of the expression syntax that is available to you - nor does the help file give you very good pointers to it...

  • Best alternatives in T-SQL are:

    ISNULL ( check_expression , replacement_value

    OR

     LEN(check_expression) = 0

     

    You are going to miss Foxpro big time.

  • Where are you looking to use this IIF EMPTY command? In the report itself, or in an SQL statement?

    You can use IIF in expressions within the report. For the SQL statement the options suggested above would be adequate.

     

    --------------------
    Colt 45 - the original point and click interface

  • well dear let me tell u boss

    in report if u want to check any field that wheather its empty or Null u ve to use VB.NET syntax that is

    =iif(field!value=nothing,"empty/Null,"have some value)

    NOTHING is used instead of EMPTY OR NULL in reporting expressions

    hope u got ur answer

    take care

     

  • If you are using IIF to fill an empty value in a select statement:

    select

       newField =

       case

          when isnull( origField, space(0) ) = space(0)  -- this field is 'empty'

          then newValue

       end, ...

    If you are just trying to find the equiv SQL for EMPTY you should use isnull or coalesce...

    Hope that helps,

    Robert

     

  • WOW!

    thanks everyone. I got LOTS of ideas and am writing something now using different statements/exressions.

    Being new to Reporting Services, we have been doing a lot of experimenting. I am thinking about getting "The Hitchhikers Guide to to SQL Reporting Services".. reading reviews about that now!

     

    Thanks again!

Viewing 8 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic. Login to reply