Datediff query

  • Hello

    I have added a calculated field into a dataset which uses this expression:

    =DateDiff("d",Fields!Date.Value,Now)

    This works fine if there is a value in fields!date.value. However, if that field is blank, it returns the value 735793.

    Is there any way I can get the expression above to say 'no date input' if the field is blank and still work as above if a date has been entered?

    Thanks.

  • Look at IIF. It should allow you to do what you want.



    Alvin Ramard
    Memphis PASS Chapter[/url]

    All my SSC forum answers come with a money back guarantee. If you didn't like the answer then I'll gladly refund what you paid for it.

    For best practices on asking questions, please read the following article: Forum Etiquette: How to post data/code on a forum to get the best help[/url]

  • =IIF(Fields.Date.Value = nothing, "No Date Input", CSTR(DateDiff("d",Fields!Date.Value,Now)))

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply