ssrs expression to find count of records which falls beween two dates

  • Hi All,

    I need assistance in building SSRS expression to find count of records between two dates. below are my conditions:

    1. Submitted Date = Today and Submitted Date <= Today()- 30

    2. Submitted Date >= Today()-31 and Submitted Date <= Today() - 60

    3. Submitted Date >= Today()-61

  • Your conditions look wrong, you cannot have a date that equals today and is less than 30 days ago!

    You can use sum and iif in an expression to count rows, ie

    =SUM(IIf(SubmittedDate>DateAdd(DateInterval.Day,-60,Today) AND SubmittedDate<DateAdd(DateInterval.Day,-30,Today),1,0))

    Far away is close at hand in the images of elsewhere.
    Anon.

  • Actually I am looking for something like "Between" operator in transact query... in short

    select count(*) from table where CAST(submitteddate AS DATE) between '2015-02-02' and '2015-01-01'

    Not sure if my below code is correct:

    =Count(iif(DateDiff("d",SubmittedDate,Now()) And DateDiff("d",SubmittedDate,Now()) <= 30,0,NOTHING))

  • Try

    =Sum(IIf(DateDiff(DateInterval.Day,Fields!SubmittedDate.Value,Today)<=30,1,0))

    Far away is close at hand in the images of elsewhere.
    Anon.

  • Hi David,

    how to find count of the records for dates between today()-31 and today()-60?

  • Sum(IIf(DateDiff(DateInterval.Day,Fields!SubmittedDate.Value,Today)>=31 AND DateDiff(DateInterval.Day,Fields!SubmittedDate.Value,Today)<=60,1,0))

    Far away is close at hand in the images of elsewhere.
    Anon.

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

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