Viewing 15 posts - 481 through 495 (of 3,500 total)
Can you join the two source tables in SQL Server, and then create a view that you can use as the source for the dimension?
November 16, 2021 at 3:52 am
That's the funny thing about posting on here. I read a ton of questions here, and post some myself. So by now, I've gotten my head around Jeff Moden's article...
November 15, 2021 at 10:12 pm
Glad it helped!
Good luck on the learning journey! Here's a really good article about posting questions - short and to the point... should be required reading. It's maybe a five...
November 5, 2021 at 5:06 am
Lisa,
Welcome! Since you're new, I created the CREATE and INSERT scripts for your question. (Posting screenshots doesn't help the folks on here recreate your scenario, so it makes it less...
November 4, 2021 at 5:37 am
Don't think you can use LAG(). I think it was introduced in SQL Server 2012.
I only suggested it because you posted in a 2019 forum.
November 3, 2021 at 4:22 am
Something like this?
--return the previous record where type is F as well.
SELECT tl1.ID, tl1.[type] as ClientType, tl1.ClientName, tl1.completedOn, tl1.CustName, tl1.CustID, tl1.PreviouslyCompletedID,
prev.id, prev.clienttype, prev.clientname, prev.CompletedOn
FROM #temp_Lookback tl1
CROSS APPLY...
November 2, 2021 at 4:26 am
Use LAG() to look at a previous record
October 29, 2021 at 8:58 pm
Upgrade and use STRING_AGG?
use tempdb;
go
create table #PartsFeature
(
PartId int,
Featurekey nvarchar(200),
FeatureValue nvarchar(200),
);
go
insert into #PartsFeature(PartId,Featurekey,FeatureValue)
values
(1550,'Botato','Yellow'),
(1550,'Mango','Red'),
(1550,'dates','Black'),
(1600,'Rice','white'),
(1600,'macrona','Red'),
(1600,'chicken','Yellow'),
...
October 28, 2021 at 2:56 am
Calculate week numbers for each sale record, then you can do something like
SELECT WeekNo = t.N, ProductID, ca.Total_Sales, ca.rnk
FROM Tally t
CROSS APPLY (SELECT TOP 10 ProductID,...
October 21, 2021 at 5:53 am
DECLARE @MyDate DATE = '10/9/2021';
SELECT DATEPART(week,@MyDate);
DATEPART(week,[DateColumn]) will return the weeknumber of the year. Just group on that.
Help yourself. Introduce yourself to the help files on SQL Server.
October 9, 2021 at 7:37 am
You'd have to use IIF([Date1]>=[Date2],[Date1],[Date2]) Then maybe do an aggregate on that expression.
October 8, 2021 at 3:18 am
Isn't the total distance covered the sum of all distances up to this pass? If that's the case, then why not use a windowing function and sum(distance)? and then use...
October 6, 2021 at 11:53 pm
Maybe Jeffrey was too subtle...
You really need to read this article:
Forum Etiquette: How to post data/code on a forum to get the best help
I'd post my attempt, but I...
September 23, 2021 at 6:18 am
Depends what the database is doing at the time. Requests get queued until the database can process the request, so sometimes it takes very little time, sometimes it takes more...
September 16, 2021 at 1:55 pm
Viewing 15 posts - 481 through 495 (of 3,500 total)