Datediff in means

  • Hi all,

    Please what is the syntax for datediff in minutes.

    I have tried the expression datediff("m", fields!startddate.value, fields!enddate.value) but it is not working. I have equally use the full minutes as in "minutes" but still not working. "mm" does not work either.

  • Not to call you lazy, but a 1-minute Google search would provide you with the answer. The first result when entering datediff into google gives the Technet documenation page.

    Heck, just even selecting datediff in SSMS and hitting F1 woul lead you directly to the documentation.

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

  • This doesn't necessarily answer your question, but, in my opinion, best practice is to use the full name, not the abbreviation so I'd use DATEDIFF(minute, '20100101', getdate()) not, DATEDIFF(mi, '20100101', getdate()).

  • I was refering to expressions and not sql. Anyway I later found out the correct one to use.

    For other people who might have the same problem, the correct expresion is to use Datediff("n", Fields!startdate.Value, Fields!enddate.Value). Minute or m or mi will not work in expressions.

    EO

  • eobiki10 (9/12/2013)


    I was refering to expressions and not sql. Anyway I later found out the correct one to use.

    For other people who might have the same problem, the correct expresion is to use Datediff("n", Fields!startdate.Value, Fields!enddate.Value). Minute or m or mi will not work in expressions.

    EO

    Glad you found your answer.

    In the future you might want post questions like this in an SSRS or SSIS forum (whichever product you needed the expression for) or if posting in a General forum like this one specifically mention the product you are working in.

  • Oddly enough, SQL is a language that contains expressions.

    It might have been useful is you had specified which language you were talking about in your first post.

    Tom

Viewing 6 posts - 1 through 5 (of 5 total)

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