Viewing 15 posts - 16 through 30 (of 214 total)
Jeff, yes it will always start on Wednesday. So the week is from Wednesday thru Tuesday.
October 27, 2022 at 5:31 pm
Something like this using a tally table or function:
DECLARE @startDate date = '2021-01-06'
DECLARE @nextYear date = DATEADD(year,1,DATEADD(year,DATEDIFF(year,0,@startDate),0));
SELECT DATEADD(WEEK,Number,@startDate ) AS StartDate, DATEADD(DAY,6,DATEADD(WEEK,Number,@startDate )) AS EndDate, Number...
October 27, 2022 at 5:09 pm
Try using the LocDocAmt only...that's the only column that matters. Also, LocDocAmt has negative amounts. The other amount columns will throw off the results in different examples.
Actually, I think...
October 10, 2022 at 4:22 pm
Try using the LocDocAmt only...that's the only column that matters. Also, LocDocAmt has negative amounts. The other amount columns will throw off the results in different examples.
October 10, 2022 at 4:18 pm
I'm not looking to delete, just exclude. See my response to Des below. I made an adjustment to the data. I left out a column by mistake.
Simply include...
October 10, 2022 at 4:07 pm
I'm not looking to delete, just exclude. See my response to Des below. I made an adjustment to the data. I left out a column by mistake.
October 10, 2022 at 11:31 am
Sorry for my lazyness in not providing the consumable data. I just realized I left out another column (LocDocAmt ) which should be the correct amt column. This changes the...
October 10, 2022 at 11:30 am
When I run Scott's code, I get this error msg?
Msg 156, Level 15, State 1, Line 6
Incorrect syntax near the keyword 'RowCount'.
Msg 156, Level 15, State 1, Line 8
Incorrect syntax...
February 24, 2020 at 6:28 pm
This is a sample of the data:
--===== If the test table already exists, drop it
IF OBJECT_ID('TempDB..#mytable','U') IS NOT NULL
...
February 24, 2020 at 4:18 pm
I think it works better with the pivot because I am joining it to create a new table...
Into POInfo
From MeritusMmPO as PO
Left Join MeritusMmPOLines as...
February 14, 2020 at 9:42 pm
February 14, 2020 at 8:58 pm
That worked...thanks!
I have a separate related issue now.
The data looks like this
When I run this code:
Select SourceID, PurchaseOrderID, [1]...
February 14, 2020 at 8:46 pm
I found my own answer! I had an issue with the ID column. Fixed that and issue resolved.
February 11, 2020 at 12:35 pm
Viewing 15 posts - 16 through 30 (of 214 total)