Weekly Report

Hi,

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:

( datediff(wk,CPTSA.dbo.Bags.dtCreated ,getdate()) = 0 )

But with that, the first day for the current week is always Sunday, and not Monday.

How can I change this?

Could you help me, please?

Regards,

Renata


santana (BOB member since 2009-04-16)

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.


Lugh (BOB member since 2009-07-16)

Hi,

thanks for your replay.

No other idea? Because I can change the set up in the database.

Thanks. Regards,

santana


santana (BOB member since 2009-04-16)

Hi Santana

if you are do Webi report try like this
create 4 variables

1)Days:=DayNumberOfWeek(CurrentDate())-1
2)Curr_week:= -[Days]
3)Test: =RelativeDate(CurrentDate();[curr_week])
4)Current Week: =[Test] + “-” + CurrentDate()

I hope it will help you

Thanks
Kittu


kittu11 (BOB member since 2010-03-02)

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.

it showed me:
tuesday - wed
100

I need:
tuesday wed
80 20

Could you help me, please!!!

Thanks.

Regards,


santana (BOB member since 2009-04-16)

Help!!! Please!


santana (BOB member since 2009-04-16)

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)

Thanks…


JohnJustus :us: (BOB member since 2007-06-25)