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

Problem with simple expression

$
0
0

Hi,

I have an SSRS report based on a SSAS cube that contains a Date field called Closing_Date.

This field can be null in the database.

The purpose is to convert the DateTime into a Date field respecting the user's locale


This expresion returns a blank for empty dates and a DateTime (yyyy/mm/dd hh:mm:ss) for non empty dates

=Fields!Closing_Date.Value,DateFormat.ShortDate

This expression returns OK for non empty dates and NOK for empty dates

=IIF(Trim(Cstr(Fields!Closing_Date.Value)) <> "","OK","NOK")

However this expression returns an #error for all empty dates. I don't understand because he should just return NOK.

Why would a change in the True part if the IIF give a different result if the date is empty.

=IIF(Trim(Cstr(Fields!Closing_Date.Value)) <> "",FormatDateTime(Fields!Closing_Date.Value,DateFormat.ShortDate),"NOK")

I get this error in the VS.Net Conversion from string "" to type 'Date' is not valid

Any Idea's?

PS : Other date fields (that don't contain null's) work correctly and can be converted with FormatDateTime function

Regards,

Sven Peeters


Viewing all articles
Browse latest Browse all 10045

Trending Articles



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