Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Iif function in SQL Server Report Builder 2012 3.0

I'm trying to make an automatic invoice but the final part gets me stuck. If a client is not from the same country as the supplier then he shouldn't pay VAT. To get this in my invoice I'm trying to insert an expression but it gives the following error:

'The Value expression for the textrun ‘Textbox16.Paragraphs[0].TextRuns[1]’ contains an error: [BC30455] Argument not specified for parameter 'FalsePart' of 'Public Function IIf(Expression As Boolean, TruePart As Object, FalsePart As Object) As Object'.'

This is the expresion I use:

=IIf(First(Fields!CustomerCountry.Value, "Invoice"))<>(First(Fields!SupplierCountry.Value, "Invoice")),0,((SUM(Fields!DurationHours.Value * Fields!HourlyRate.Value))*0.21)

Can anyone help please?

Thanks in advance

like image 807
Jorgen V Avatar asked Jul 19 '26 05:07

Jorgen V


1 Answers

You have an extra parenthesis in your iif statement, at the first First function. Try this instead:

=IIf(First(Fields!CustomerCountry.Value, "Invoice")<>(First(Fields!SupplierCountry.Value, "Invoice")),0,((SUM(Fields!DurationHours.Value * Fields!HourlyRate.Value))*0.21))
like image 131
TPhe Avatar answered Jul 20 '26 21:07

TPhe



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!