Reputation: 55
I have a report on daily base date and I get a table where it display data of today when I run for today date.
Then I have a line chart which shows the graph of that date and the count of hit. Here, I need the graph to be shown for the whole month when I run the report not for only single date.
Please let me know the logic .
Thank you
Upvotes: 1
Views: 88
Reputation: 56
Create a new Dataset and define variables containing the range of data you need for whole month graph. Then select data using the variables.
Declaring variables:
declare @startOfMonth datetime2 = (SELECT DATEADD(month, DATEDIFF(month, 0, getdate()), 0))
declare @endOfMonth datetime2 = getdate()
Next, use this variables in your query:
select
/*
all data you need
*/
where date_of_data >= @startOfMonth and date_of_data <= @endOfMonth
Then use this Dataset in your new monthly graph.
Upvotes: 1