Viewing 15 posts - 706 through 720 (of 3,489 total)
Oops, yes, I did miss it. This is what I used. (Funny I would get the answer right and then miss copying it... the easy part!)
SELECT AllergyName
,LowStart...
June 3, 2020 at 2:54 am
This is how I did it...
SELECT AllergyName
,LowStart = MAX(CASE WHEN ScaleValue = 'Low' THEN ScaleStart END)
,LowEnd = MAX(CASE WHEN ScaleValue = 'Low' THEN ScaleEnd END)
,ModerateStart = MAX(CASE...
June 3, 2020 at 12:31 am
I could do it like this, I suppose...
use AdventureWorks2017;
go
-- what parts are in stock
SELECT currInv.ProductId
, currInv.TotalQOH
, sod.OrderQty
, rt_Sold = SUM(sod.OrderQty) OVER (PARTITION BY currInv.ProductID
ORDER BY soh.OrderDate
ROWS...
June 2, 2020 at 10:27 pm
I'll give you a hint... MAX( CASE WHEN...)
It's a LOT of that.
Jeff Moden posted an article on Crosstabs... that might help too. (Don't want to give the game away... I...
June 2, 2020 at 6:05 pm
IF NOT OBJECT_ID('tempdb..#AirAndPollenScale') IS NULL
DROP TABLE #AirAndPollenScale
CREATE TABLE #AirAndPollenScale(
[AllergyScaleID] [int],
[AllergyName] [nvarchar](max) NULL,
[ScaleStart] [int] NULL,
[ScaleEnd] [int] NULL,
[ScaleValue] [nvarchar](100) NULL,
)
INSERT #AirAndPollenScale ([AllergyScaleID], [AllergyName], [ScaleStart], [ScaleEnd], [ScaleValue]) VALUES (1,... June 2, 2020 at 4:15 pm
I would swear I've seen this before. I think I solved it by running SSMS as local administrator, and it will work. Right-click SSMS, click 'Run as administrator' and then...
June 2, 2020 at 1:24 am
It's hard to tell without seeing at the very least the table definition of tApplication, and a few dummy records. But 105 columns is a lot - it's possible that...
June 1, 2020 at 11:46 pm
I need to delete the rows where status = 1
DELETE
FROM TestPO
WHERE Status=1;
?
From your description, it's not at all clear what records you really want deleted. Which record(s) are duplicates? How...
May 27, 2020 at 2:09 am
Something I should practice... for sure!
I have to admit that my very first response to the question was "Can I do this with the dbatools PowerShell library?" I should have...
May 25, 2020 at 1:55 am
Oh cool, super helpful!! Like I said, I have a lot to learn still! But I'll work my way through it.
Thanks for the feedback!
May 13, 2020 at 11:10 pm
They're grading side effects. It was cancer drug testing. It was one of those jobs was okay until things slowed down enough that I could stop and think about the...
May 13, 2020 at 4:48 pm
That's how I received them (and by the dozen) - that's why I was wondering how to normalize them in T-SQL . It was a totally screwed up situation where...
May 13, 2020 at 3:10 pm
Oh wait... I'm so bright somedays, it hurts my eyes. Use a cursor to loop over the column list. After the first 2 columns, count off (1 => column name...
May 12, 2020 at 3:31 am
I would break the SupportingDocs stuff out into a separate table with the foreign key (do this in Access) and then import that. I'd have to play with it a...
May 7, 2020 at 1:23 pm
Like this?
Setup:
--Setup:
CREATE TABLE WorkData (
EmpNo INT,
JobNo VARCHAR(10),
Hrs DECIMAL(4,2));
-- add some data
INSERT INTO WorkData VALUES
(8000 , 'Office'...
May 5, 2020 at 9:04 pm
Viewing 15 posts - 706 through 720 (of 3,489 total)