Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2012 Forums
 SQL Server Administration (2012)
 SSRS Rerport filter data between current Week

Author  Topic 

yomi
Starting Member

25 Posts

Posted - 2014-05-10 : 02:37:14
Hi All,

I want to filter data between current week on filter.
but the current week will be like,
If today is sunday then it will show only sunday data on report for current week.
If today is Monday then it will show only sunday and Monday data on report for current week.
If today is Tuesday then it will show only sunday and Monday nad Tuesday data on report for current week.
and so on for current week.

Yogesh

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2014-05-12 : 07:15:24
just use a logic like below in query behind

WHERE datefield >= DATEADD(wk,DATEDIFF(wk,0,GETDATE()),-1)
AND datefield < DATEADD(dd,DATEDIFF(dd,0,GETDATE()),1)


also see
http://visakhm.blogspot.in/2012/12/different-ways-to-implement-date-range.html

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page
   

- Advertisement -