Counting and displaying dates in SSRS

  • Hello,

    I'm modifying a report to display the number of days worked. So, for example, if a job takes three days (but not necessarily contiguous) then the count should be three days.

    The problem is, as I mentioned, the days may or may not be contiguous. Also if two or more parts of a job are completed on the same day then that counts as one day i.e. three tasks completed in one day counts as one in my total days.

    So, I've tried "=Count(Fields!TicketDate.Value)" which returns a count of days from the first date to the last which is not right.

    I want to be able to find a specific date and then increment my count. If that date is repeated in the list then I only count it once.

    Instead of having to code this, I'm wondering if there's a function (or some shortcut) so I don't have to write this in my expression option in SSRS.

    thanks,

    Paul

  • OK, I've used 'CountRows' specifying year, month and day (excluding variable hh:mm:ss)

  • Very good. Thanks for posting your answer....It's funny and it happens to me a lot, asking the question helps us find our own answers sometimes.....

  • Thanks Bob,

    Yes, it's funny how that happens but it's always good to ask around and there's no better place to ask than this forum.

    I'm on a few forums but there's none better, in my opinion, when it comes to SQL Server issues. When you need the right answer fast - SQLServerCentral is the best.

    Paul

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

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