SSRS IF Statement with incorrect syntax
up vote
0
down vote
favorite
I'm new to SSRS and find the syntax very difficult as well as the awful expression text box that makes it very hard to see where i've made errors.
I want to do IFF (First(Fields!TaxNumber.Value, "InvoiceHeader") = null, then only print IS02Chars.value, else print both IS02Chars and TaxNumber.Value.
=IFF (First(Fields!TaxNumber.Value, "InvoiceHeader") = null ,
": " & First(Fields!ISO2Chars.Value, "InvoiceHeader"),
": " & First(Fields!ISO2Chars.Value, "InvoiceHeader") & First(Fields!TaxNumber.Value, "InvoiceHeader"))
I don't see how my syntax is any different to IIF(Fields!ExitReason.Value = 7, 1, 0)
if-statement reporting-services syntax expression
|
show 1 more comment
up vote
0
down vote
favorite
I'm new to SSRS and find the syntax very difficult as well as the awful expression text box that makes it very hard to see where i've made errors.
I want to do IFF (First(Fields!TaxNumber.Value, "InvoiceHeader") = null, then only print IS02Chars.value, else print both IS02Chars and TaxNumber.Value.
=IFF (First(Fields!TaxNumber.Value, "InvoiceHeader") = null ,
": " & First(Fields!ISO2Chars.Value, "InvoiceHeader"),
": " & First(Fields!ISO2Chars.Value, "InvoiceHeader") & First(Fields!TaxNumber.Value, "InvoiceHeader"))
I don't see how my syntax is any different to IIF(Fields!ExitReason.Value = 7, 1, 0)
if-statement reporting-services syntax expression
You need to add a second part for the IIF condition turns out to be FALSE. Add a comma prior to the double close brackets and enter something that needs to be returned when the value is not null
– MiguelH
Nov 8 at 11:23
Can't I do IFF NULL show IS02Chars else Show IS02Chars AND TaxNumber? The second part acts as my not null
– Fusiozii
Nov 8 at 11:29
Are these numeric value? If so. you'll need to cast these as strings (Cstr
) if you want to concatenate with other values...
– MiguelH
Nov 8 at 11:39
@Greg2 I'm sure=IFF
is not correct syntax, it should normally be=IIF
. Plus you would want to do as Miguel said and cast if your values are numeric before concatenating them.
– arahman
Nov 8 at 11:56
@Greg2 I completely missed the=IFF
! Good spotting! :-)
– MiguelH
Nov 8 at 12:29
|
show 1 more comment
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I'm new to SSRS and find the syntax very difficult as well as the awful expression text box that makes it very hard to see where i've made errors.
I want to do IFF (First(Fields!TaxNumber.Value, "InvoiceHeader") = null, then only print IS02Chars.value, else print both IS02Chars and TaxNumber.Value.
=IFF (First(Fields!TaxNumber.Value, "InvoiceHeader") = null ,
": " & First(Fields!ISO2Chars.Value, "InvoiceHeader"),
": " & First(Fields!ISO2Chars.Value, "InvoiceHeader") & First(Fields!TaxNumber.Value, "InvoiceHeader"))
I don't see how my syntax is any different to IIF(Fields!ExitReason.Value = 7, 1, 0)
if-statement reporting-services syntax expression
I'm new to SSRS and find the syntax very difficult as well as the awful expression text box that makes it very hard to see where i've made errors.
I want to do IFF (First(Fields!TaxNumber.Value, "InvoiceHeader") = null, then only print IS02Chars.value, else print both IS02Chars and TaxNumber.Value.
=IFF (First(Fields!TaxNumber.Value, "InvoiceHeader") = null ,
": " & First(Fields!ISO2Chars.Value, "InvoiceHeader"),
": " & First(Fields!ISO2Chars.Value, "InvoiceHeader") & First(Fields!TaxNumber.Value, "InvoiceHeader"))
I don't see how my syntax is any different to IIF(Fields!ExitReason.Value = 7, 1, 0)
if-statement reporting-services syntax expression
if-statement reporting-services syntax expression
edited Nov 8 at 11:36
asked Nov 8 at 11:12
Fusiozii
225
225
You need to add a second part for the IIF condition turns out to be FALSE. Add a comma prior to the double close brackets and enter something that needs to be returned when the value is not null
– MiguelH
Nov 8 at 11:23
Can't I do IFF NULL show IS02Chars else Show IS02Chars AND TaxNumber? The second part acts as my not null
– Fusiozii
Nov 8 at 11:29
Are these numeric value? If so. you'll need to cast these as strings (Cstr
) if you want to concatenate with other values...
– MiguelH
Nov 8 at 11:39
@Greg2 I'm sure=IFF
is not correct syntax, it should normally be=IIF
. Plus you would want to do as Miguel said and cast if your values are numeric before concatenating them.
– arahman
Nov 8 at 11:56
@Greg2 I completely missed the=IFF
! Good spotting! :-)
– MiguelH
Nov 8 at 12:29
|
show 1 more comment
You need to add a second part for the IIF condition turns out to be FALSE. Add a comma prior to the double close brackets and enter something that needs to be returned when the value is not null
– MiguelH
Nov 8 at 11:23
Can't I do IFF NULL show IS02Chars else Show IS02Chars AND TaxNumber? The second part acts as my not null
– Fusiozii
Nov 8 at 11:29
Are these numeric value? If so. you'll need to cast these as strings (Cstr
) if you want to concatenate with other values...
– MiguelH
Nov 8 at 11:39
@Greg2 I'm sure=IFF
is not correct syntax, it should normally be=IIF
. Plus you would want to do as Miguel said and cast if your values are numeric before concatenating them.
– arahman
Nov 8 at 11:56
@Greg2 I completely missed the=IFF
! Good spotting! :-)
– MiguelH
Nov 8 at 12:29
You need to add a second part for the IIF condition turns out to be FALSE. Add a comma prior to the double close brackets and enter something that needs to be returned when the value is not null
– MiguelH
Nov 8 at 11:23
You need to add a second part for the IIF condition turns out to be FALSE. Add a comma prior to the double close brackets and enter something that needs to be returned when the value is not null
– MiguelH
Nov 8 at 11:23
Can't I do IFF NULL show IS02Chars else Show IS02Chars AND TaxNumber? The second part acts as my not null
– Fusiozii
Nov 8 at 11:29
Can't I do IFF NULL show IS02Chars else Show IS02Chars AND TaxNumber? The second part acts as my not null
– Fusiozii
Nov 8 at 11:29
Are these numeric value? If so. you'll need to cast these as strings (
Cstr
) if you want to concatenate with other values...– MiguelH
Nov 8 at 11:39
Are these numeric value? If so. you'll need to cast these as strings (
Cstr
) if you want to concatenate with other values...– MiguelH
Nov 8 at 11:39
@Greg2 I'm sure
=IFF
is not correct syntax, it should normally be =IIF
. Plus you would want to do as Miguel said and cast if your values are numeric before concatenating them.– arahman
Nov 8 at 11:56
@Greg2 I'm sure
=IFF
is not correct syntax, it should normally be =IIF
. Plus you would want to do as Miguel said and cast if your values are numeric before concatenating them.– arahman
Nov 8 at 11:56
@Greg2 I completely missed the
=IFF
! Good spotting! :-)– MiguelH
Nov 8 at 12:29
@Greg2 I completely missed the
=IFF
! Good spotting! :-)– MiguelH
Nov 8 at 12:29
|
show 1 more comment
1 Answer
1
active
oldest
votes
up vote
0
down vote
=IIF(IsNothing(First(Fields!TaxNumber.Value, "InvoiceHeader")), ": "
& First(Fields!ISO2Chars.Value, "InvoiceHeader") , ": " &
First(Fields!ISO2Chars.Value, "InvoiceHeader") &
First(Fields!TaxNumber.Value, "InvoiceHeader" ) )
1
Generally, answers are much more helpful if they include an explanation of what the code is intended to do, and why that solves the problem without introducing others.
– lucascaro
Nov 9 at 6:47
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
=IIF(IsNothing(First(Fields!TaxNumber.Value, "InvoiceHeader")), ": "
& First(Fields!ISO2Chars.Value, "InvoiceHeader") , ": " &
First(Fields!ISO2Chars.Value, "InvoiceHeader") &
First(Fields!TaxNumber.Value, "InvoiceHeader" ) )
1
Generally, answers are much more helpful if they include an explanation of what the code is intended to do, and why that solves the problem without introducing others.
– lucascaro
Nov 9 at 6:47
add a comment |
up vote
0
down vote
=IIF(IsNothing(First(Fields!TaxNumber.Value, "InvoiceHeader")), ": "
& First(Fields!ISO2Chars.Value, "InvoiceHeader") , ": " &
First(Fields!ISO2Chars.Value, "InvoiceHeader") &
First(Fields!TaxNumber.Value, "InvoiceHeader" ) )
1
Generally, answers are much more helpful if they include an explanation of what the code is intended to do, and why that solves the problem without introducing others.
– lucascaro
Nov 9 at 6:47
add a comment |
up vote
0
down vote
up vote
0
down vote
=IIF(IsNothing(First(Fields!TaxNumber.Value, "InvoiceHeader")), ": "
& First(Fields!ISO2Chars.Value, "InvoiceHeader") , ": " &
First(Fields!ISO2Chars.Value, "InvoiceHeader") &
First(Fields!TaxNumber.Value, "InvoiceHeader" ) )
=IIF(IsNothing(First(Fields!TaxNumber.Value, "InvoiceHeader")), ": "
& First(Fields!ISO2Chars.Value, "InvoiceHeader") , ": " &
First(Fields!ISO2Chars.Value, "InvoiceHeader") &
First(Fields!TaxNumber.Value, "InvoiceHeader" ) )
answered Nov 8 at 14:06
Fusiozii
225
225
1
Generally, answers are much more helpful if they include an explanation of what the code is intended to do, and why that solves the problem without introducing others.
– lucascaro
Nov 9 at 6:47
add a comment |
1
Generally, answers are much more helpful if they include an explanation of what the code is intended to do, and why that solves the problem without introducing others.
– lucascaro
Nov 9 at 6:47
1
1
Generally, answers are much more helpful if they include an explanation of what the code is intended to do, and why that solves the problem without introducing others.
– lucascaro
Nov 9 at 6:47
Generally, answers are much more helpful if they include an explanation of what the code is intended to do, and why that solves the problem without introducing others.
– lucascaro
Nov 9 at 6:47
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53206583%2fssrs-if-statement-with-incorrect-syntax%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
You need to add a second part for the IIF condition turns out to be FALSE. Add a comma prior to the double close brackets and enter something that needs to be returned when the value is not null
– MiguelH
Nov 8 at 11:23
Can't I do IFF NULL show IS02Chars else Show IS02Chars AND TaxNumber? The second part acts as my not null
– Fusiozii
Nov 8 at 11:29
Are these numeric value? If so. you'll need to cast these as strings (
Cstr
) if you want to concatenate with other values...– MiguelH
Nov 8 at 11:39
@Greg2 I'm sure
=IFF
is not correct syntax, it should normally be=IIF
. Plus you would want to do as Miguel said and cast if your values are numeric before concatenating them.– arahman
Nov 8 at 11:56
@Greg2 I completely missed the
=IFF
! Good spotting! :-)– MiguelH
Nov 8 at 12:29