Count user names activated in the last month

0 Answers 68 Views
DataSources Expressions Filtering Report Designer (standalone)
tony
Top achievements
Rank 1
tony asked on 22 Dec 2021, 05:23 PM | edited on 23 Dec 2021, 01:19 PM

Hi all,

I am new to Telerik and stuck.  Using Report Designer ver. 15.1.21.616.  Have a basic table which has user names and timestamps for when their accounts were activated.  Need to get a simple count of how many were activated in the last 30, 60 and 90 days. Tried with the main (server side) query such as 

Select name, ActionTimeStamp from UserRequest where ActionTimeStamp > AddMonths(Today(),-1)

or,

Select name, ActionTimeStamp from UserRequest where ActionTimeStamp > DATEADD(day, -30, getdate())

to no avail; getting different kinds of errors. 

Tried downloading the whole table (without a WHERE statement) and use an expression imbedded inside a Text Box to get the count. Just to make sure the function works, tried: 

[= AddMonths(Today(),-1)] 

and it works, it gives me the date 30 days before today. So tried to build on AddMonths(). Tried the following, and any combination that I could think of, and yet cannot get any results!!

[= "Recs last month: " + Count(CDate(Fields.ActionTimeStamp) > CDate(AddMonths(Today(),-1)))]

What am I doing wrong?

Greatly appreciate your help; thank you, guys,

Tony

tony
Top achievements
Rank 1
commented on 23 Dec 2021, 01:22 PM

Figured out the answer.  

Select name, ActionTimeStamp from UserRequest where DATEDIFF(day, ActionTimeStamp , GETDATE()) < 60

 

No answers yet. Maybe you can help?

Tags
DataSources Expressions Filtering Report Designer (standalone)
Asked by
tony
Top achievements
Rank 1
Share this question
or