Login   Register 
Receive news via our XML/RSS feed
Home | Book | Contents | Preview | Articles | Tools | Newsletters | Premium | Ask | About

Home

Book

Contents

Preview

Articles

Tools

Newsletters

Premium

Ask

About

Most Popular Articles
  • Using Secure Sockets Layer (SSL) for SQL Server 2000 Reporting Services
    Creating an SSL Certificate to ensure your confidential reports remain confidential


  •  
    Beta V Corporation
     
     
    SQL Reporting Services - Answers to your questions
     
    Author Thread: DateDiff Error
    Kathyc

    DateDiff Error
    Posted: Sunday, March 15, 2009 1:16 PM (GST)


    In my SRS report, I need to calculate the num of days between the date the record
    was created on and the date the record was closed. I used this function in  the
    expression area of my textbox:

     

    =DateDiff ("d", Fields!actualclosedate, Fields!createdon)

     

    I get this error:

     

    [rsRuntimeErrorInExpression] The Value expression for the textbox ‘textbox6’ contains an
    error: Argument 'Date1' cannot be converted to type 'Date'.

     

    I verfied that the 2 fields were in fact date fields.

    What have I done wrong?


     

     

    Comments:  

    Author Thread:
    William Vaughn
    DateDiff Error
    Posted: Sunday, March 15, 2009 8:07 PM (GST)
    I've seen this too. The problem is that unless you force type conversion, the Value field is treated like a string. I would try this: =DateDiff ("d", Cdate(Fields!actualclosedate), Cdate(Fields!createdon)) I created an example of how this is done against AdventureWorks2008. It implements the "new" RDL so it won't work with 2005 but you can see the Report filter expressions I used in more detail. In any case, make sure to prefix the expression and the right-hand side value of the expression with "=". I put the RDL file on my blog. http://betav.com/blog/billva hth

     
     
     
     
     
    Home | Book | Contents | Preview | Articles | Tools | Newsletters | Premium | Ask | About