Quantcast
Channel: SQL Server Reporting Services, Power View forum
Viewing all articles
Browse latest Browse all 10045

Report expression is throwing "#Error" and I can't see why...

$
0
0

All,

I have the following expression to evaluate a datetime column coming from the database:

* If the row is NULL, display "N/A".

* If the row is normal, display it as normal with a custom format.

* If the row is normal but contains the hour of "1", roll it back 1 second and display it with a custom format.

=IIF(IsNothing(Fields!Report_EndDate.Value),"N/A",IIF(Hour(Fields!Report_EndDate.Value)=1,(Format(DateAdd("n", -1, Fields!Report_EndDate.Value), "yyyy-MM-dd HH:mm:ss")),Format(Fields!Report_EndDate.Value, "yyyy-MM-dd HH:mm:ss")))

Here's the problem - when the row is NULL (condition #1) - the textbox is showing "#Error". But when I just use the base of the expression:

=IIF(IsNothing(Fields!Report_EndDate.Value),"N/A","TEST")

It works fine.

Could someone please point out what I'm missing here that would be causing this problem?



Viewing all articles
Browse latest Browse all 10045

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>