Viewing 15 posts - 676 through 690 (of 3,480 total)
This works... you need a GO statement between your CREATE and INSERT statements if you're going to run a single script, because they have to be in different batches.
June 29, 2020 at 6:46 pm
use AdventureWorks2017;
go
DECLARE @SalesOrderID INT = 43659;
SELECT SalesOrderID
-- , ProductID
-- , bom.AssemblyName
, bom.Component
, bom.ComponentID
-- , bom.PerAssemblyQty
, TotalPartQty = CAST(SUM(OrderQty * bom.PerAssemblyQty) AS INT)
FROM Sales.SalesOrderDetail sod
CROSS APPLY dbo.udfProductBOM(sod.ProductID) bom
WHERE...
June 24, 2020 at 6:58 pm
So where are you stuck? Post the SQL statement(s), so we can figure out how to help you.
June 22, 2020 at 9:14 am
have you looked up GROUP BY yet?
June 22, 2020 at 12:32 am
This is close, but it needs to be changed for the first week of year/last week of previous year comparison.
=CALCULATE( [Total Sales],
...
June 20, 2020 at 12:25 pm
Oh, sorry... left out a bit of critical information/part of a step. If you want to allow the parameter to be null, do this:
With the report in design mode, right-click...
June 19, 2020 at 4:50 pm
Assuming you cannot modify the stored procedure, and you want to be able to filter out all records WHERE CaseCompleted IS NULL, you can add a filter to your report...
June 19, 2020 at 1:32 pm
Is there helpful documentation on the PATINDEX function somewhere? the stuff on the MSFT site is useless.
June 18, 2020 at 4:11 am
Don't you have to use Contains for that?
--method of the xml data type. Inside the exit method,
--the XQuery contains()function is used to
--determine whether...
June 18, 2020 at 2:58 am
This is ugly, but appears to work. (Someone who knows how to do this better than I will undoubtedly chime in and show a much better way of doing it,...
June 18, 2020 at 2:34 am
The short answer to your question is to use the LAG function to get the value from the previous record. Something like this...
LAG([LoginTime],1) OVER (PARTITION BY EmpID ORDER BY [LoginTime])
Oh...
June 17, 2020 at 3:00 pm
Maybe use SSIS and a For Each file loop, and dump them all into a single table?
Or use Excel... put all the files in a single folder, use a folder...
June 16, 2020 at 4:38 pm
1 lakh = 100,000
June 16, 2020 at 2:51 pm
This place is really quiet compared to the normal before COVID. Makes me wonder if all the SQL folks got laid off.
June 16, 2020 at 12:29 am
If EffectiveDate indexed? What does the new execution plan look like for the updated query?
June 14, 2020 at 6:08 am
Viewing 15 posts - 676 through 690 (of 3,480 total)