2 Replies Latest reply on Jul 22, 2016 6:46 AM by khalid norat

# calculate number of records for the year 2016 and a year back.

I want to calculate number of record for this year that is 2016 . So , it will give me all the records for this year till date.

I have used the logic

IF

DATEPART('year' , [datefield] ) = DATEPART('year' , Today())

Then

number of records

end

Similarly I want to go back on the same day of the previous year. For example as today is 07/21/2016, so I want to go back to 07/21/2016 and take the number of records for the time span

(01/01/2015 to 07/21/2016) . Please ignore the leap year date 02/29 issue while providing the logic.

Thanks ,

NK

• ###### 1. Re: calculate number of records for the year 2016 and a year back.

if [DateField] <= dateadd('year', -1, today()) and year([DateField] = year(Today())-1 then

number of records,

end

• ###### 2. Re: calculate number of records for the year 2016 and a year back.

Hope this makes sense let me know if you need further clarification