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.
Author |
Topic |
mmdjs
Starting Member
2 Posts |
Posted - 2012-02-29 : 15:24:10
|
Hi everybody, this is my first post so hopefully I am posting in the right spot i apologize if I am not ,I have this SP I am working on or modifying so to speak it currently stores a week of field in my tempresults table but the problem I am having is i also have a parameter for mtd as seen in this code hereELSE IF @Interval = 'M' -- Current Month BEGIN SET @Startdate = CONVERT(VARCHAR(25),DATEADD(dd,-(DAY(@Startdate)-1),@Startdate),101) SET @EndDate = CONVERT(VARCHAR(25),DATEADD(DAY,-1,GetDate())) ENDI need my week range to be Friday to Saturday, instead of how it is now here is my week of insertINSERT INTO #TempResults (Sorter, Week_Of, Row_Date, int_day_key) SELECT 1, DatePart(Week,row_date ) as Week_Of, Convert(Varchar, row_date,101), day_key FROM dbo.vw_dim_date (NOLOCK) Where row_date >= @StartDate And row_date <= @EndDate Any chance anyone knows how to modify this really quickly to give me the Friday to saturday range in my results set ? |
|
X002548
Not Just a Number
15586 Posts |
|
mmdjs
Starting Member
2 Posts |
Posted - 2012-02-29 : 15:37:35
|
Well it would be mtd so it would show whatever the first was up until thursday for the first week then start the new week friday to saturday after that. |
 |
|
|
|
|
|
|