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

Date constant is not valid using IIF and DateAdd expressions

$
0
0

Dear all,

For a personnel report I wish to change the end date of a permanent contract into the retirement date (67 years). If the employee has a temporary contract, the end date should be according to the contract. Our system uses 31-12-2999 as a default value for the end date of permanent contracts. 

I have formulated the following formula:

IIF(Fields!EndDateContract.Value=#31-12-2999#,DateAdd(DateInterval.Year,67,Fields!DateOfBirth.Value),Fields!EndDateContract.Value)

When I run the report I see the following error: The Value expression for the textrun ‘EndDateContract.Paragraphs[0].TextRuns[0]’ contains an error: [BC31085] Date constant is not valid

If I only enter DateAdd(DateInterval.Year,67,Fields!DateOfBirth.Value) the report works fine. Any ideas what the problem is? How can I solve this?

N.B. I work in SQL server 2008 R2. Report Builder 3.0 

Many thanks in advance !

Regards, Rita


Viewing all articles
Browse latest Browse all 10045

Trending Articles



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