Viewing 15 posts - 106 through 120 (of 3,396 total)
You have to sum first, and then use LAG on that result to get what you want... like this... Oh, and since you're new, I created tables for you etc....
June 26, 2023 at 10:34 pm
are you using Tabular or Multi-dimensional?
in tabular, you don't need a separate date table. Just use ALL() to remove whatever filters you want from the evaluation context.
June 11, 2023 at 6:56 pm
Are you attempting to restore over the top of another database? (Did you change the name of the database you're restoring? You should have). Once you do that, you can...
June 4, 2023 at 11:06 pm
"But in this case the business is using Access managing their own Access db. So looking for same functionality but with a SQL Server. Please advise? Thanks in Advance!"
Maybe I...
June 3, 2023 at 9:21 pm
Could you use EXISTS () with a correlated subquery instead of APPLY? (or is that just brutally slow?)
May 26, 2023 at 7:20 pm
a generic recipe is something like this:
CREATE TABLE Recipe (
FinalProductID INT NOT NULL,
IngredientID INT NOT NULL,
Quantity INT NOT NULL CHECK (Quantity>0)
CONSTRAINT pkRecipe PRIMARY KEY (FinalProductID, IngredientID)
);
The "amount" output is the...
May 21, 2023 at 4:02 pm
Disclaimer: I'm not an expert, but this worked for me... I didn't create mad dynamic SQL, but...
("Ingredient" is just some table I had in a database... nothing special.) But I...
May 18, 2023 at 11:29 pm
You can do this with text functions like CHARINDEX, LEFT, RIGHT.
What have you tried?
May 4, 2023 at 11:20 pm
Google-fu not working? See this page...
use tempdb;
go
DECLARE @MyMachine NVARCHAR(128);
SELECT @MyMachine = CAST(SERVERPROPERTY('MachineName') AS NVARCHAR(128))
PRINT @MyMachine + ' is a piece of junk';
May 4, 2023 at 1:21 am
LOL. That's exactly how I feel about touchscreen radio controls. Are those things designed to kill me? I thought the whole idea was to be able to use the radio...
May 3, 2023 at 5:06 pm
T-SQL is pretty big (there are lots of functions etc). One way to learn it is to break it up into chunks. So you get a database and start asking...
April 26, 2023 at 7:54 pm
That's the way education is though. when I was in undergrad, one of my professors said something like "You thought I was here to teach you. That's where you're mistaken:...
April 26, 2023 at 1:48 am
It's okay to be new. But please post what you tried in order to solve the problem. one thing it does is it forces you to recreate the problem for...
April 25, 2023 at 9:16 pm
I'd submit a tested query, but I don't have any data to test it on... so, all I can offer is a vague generality.
If you use CROSS APPLY, you can...
April 22, 2023 at 2:16 am
I'm not saying that Joe isn't insanely smart. Not at all. He absolutely is. He's just ... (What's the right word??!!) .. inflexible? Kinda like an Aspie with Attitude? Perhaps...
April 18, 2023 at 6:40 pm
Viewing 15 posts - 106 through 120 (of 3,396 total)