My user wants to see the report by weekly, the current week.
But the first day week, needs to be Monday and not Sunday.
The firts day I will run the report will be Tue, and shows me Monday data. When I run on Wed shows me Monday and Tuesday data … and when I run Monday, shows me Monday to Sun (last week).
I am using the SQL Server database.
And this function:
Oddly enough, some quick Googling suggests that the only way to do this is to use the SET DATEFIRST function to change which day of the week is first as a global setting in the database. It doesn’t look like SQL Server has the parameter in the date functions to specify it on the fly.
Thanks for your help and replay.
But It didnt work.
The week started with Tuesday, not Monday, what is great.
But it showed the all week day for the current week in only one cel.
I need it separeted.
I am using Sybase and my Current week filter object is below, Not sure if it is going to help you. Give it a try
dbo.rms_dim_date.cal_date<=getdate()
and dbo.rms_dim_date.cal_date>=(select convert(datetime,dbo.rms_dim_date.week_start_date_display) from dbo.rms_dim_date where cal_date=convert(datetime,convert(char(12),dateadd(wk,-0,getdate()))))
To me it displays data from 07/26/2010-08/01/2010 (Current Week - Monday to Sunday)