Viewing 15 posts - 646 through 660 (of 3,480 total)
Looks like you need two instances of TB_EMP to join on the welder key and another to join on the Operator key.
July 31, 2020 at 6:03 pm
Are you trying to create an aging query, so that each invoice is "binned" by age, which is determined by [DocDate]? (the usual is something like "less than 30 days",...
July 29, 2020 at 3:00 pm
Just to see if I could do it, I wrote some code to do the testing for me... <g>
I shamelessly stole Phil's checking code.... Seems to work, though.
July 22, 2020 at 6:34 pm
Steve,
Since it's only looking at column names and not rows of data, it seems this could be done easily with a little bit of dynamic SQL (just get a list...
July 22, 2020 at 4:22 pm
Maybe this and use it as a cursor so I can create the columns that way?
use tempdb;
GO
IF OBJECT_ID('tempdb..#Test2') IS NOT NULL DROP TABLE #Test2
CREATE TABLE #Test2
(A int,...
July 22, 2020 at 2:55 pm
That many points and no consumable data?
SvcAcct is used on different ServerNames
SELECT ServiceAccount
FROM Accounts a INNER JOIN Servers s ON a.ServerID = s.ServerID
GROUP BY ServiceAccount
HAVING COUNT(*)>1
July 22, 2020 at 2:37 pm
Oh, so it's not an "out of the box" thing. I was watching one of Brent Ozar's videos on SSMS, and I thought it was. Thanks! Might have to splurge...
That's...
July 22, 2020 at 2:22 pm
I believe that the editor window colors are a windows user specific setting, not a SQL session specific setting.
=(
Drat. So at least I might not be as dumb as I...
July 21, 2020 at 10:33 pm
DECLARE @p_start_date DATETIME = CAST('2017-12-01 00:00:00' AS DATETIME);
DECLARE @p_end_date DATETIME = CAST('2017-12-31 00:00:00' AS DATETIME);
SELECT
DATEDIFF( HOUR
, @p_start_date
, @p_end_date
); July 21, 2020 at 6:11 pm
Like this maybe?
DELETE
FROM #tblTest1
WHERE ID IN (
SELECT ID
FROM #tblTest1 t1
CROSS APPLY STRING_SPLIT(t1.SName, '/') ss
WHERE ss.value IN (SELECT SName FROM #tblTest2)
);
July 20, 2020 at 8:51 pm
Did you try running SSMS as admin, too?
July 19, 2020 at 8:23 pm
One way is to use a Calendar table, and to include Fiscal Month and Fiscal Quarter, and join to that. And then do the pivot
July 17, 2020 at 4:32 am
Without a Contacts table, you can't do it.
You'd get all the contacts who had been contacted in the last 18 months, and then exclude those ContactIDs from those in the...
July 15, 2020 at 9:00 pm
STRING_AGG()?
USE AdventureWorks2017;
GO
SELECT OrganizationLevel
, STRING_AGG(CONVERT(nvarchar(max), JobTitle), CHAR(13)) AS csv
FROM HumanResources.Employee
GROUP BY OrganizationLevel;
July 15, 2020 at 3:11 pm
Viewing 15 posts - 646 through 660 (of 3,480 total)