Viewing 15 posts - 421 through 435 (of 3,509 total)
You don't really need to store the duration at all. Well, unless you really want to for some reason. (I guess it's okay, because once a duration is calculated, it's...
January 26, 2022 at 3:18 pm
Ouch! Not exactly a rookie question! Since you're brand new, I created a simple table...
use tempdb;
go
CREATE TABLE deviceActivity (
deviceID int not null,
EventName CHAR(3) not null,
EventTime datetime not...
January 25, 2022 at 9:52 pm
Some consumable data (CREATE TABLE and INSERT scripts) would be really nice.
If the On/Off events are in pairs (so you can't two "On" events in a row for the same...
January 25, 2022 at 9:11 pm
How are you using your data warehouse data? If you're using PowerBI or Excel, there's a USERELATIONSHIP() function, where you can have multiple relationships between two tables (like Sales fact...
January 24, 2022 at 2:54 pm
For example? maybe check out Jeff Moden's article on Crosstabs
January 21, 2022 at 2:44 pm
Your case statement is a bit off... try this:
use tempdb;
go
CREATE TABLE tibbleTransactions(TransactionID INT IDENTITY, TransactionDescription VARCHAR(10), Amount INT);
GO
INSERT INTO tibbleTransactions(TransactionDescription, Amount) VALUES ('Positive',10),('Negative',20),('Positive',20);
SELECT TransactionID, TransactionDescription, Amount
FROM tibbleTransactions;
SELECT...
January 21, 2022 at 4:38 am
Use a running aggregate before you pivot?
SELECT n
, rt = SUM(t.n) OVER (order by n rows between unbounded preceding and current row)
FROM Testdb.dbo.tally t;
tally is just a...
January 19, 2022 at 10:47 pm
Understanding what the different tables describe helps a lot. You don't necessarily have to understand the entire diagram, just the part(s) you're going to use.
January 16, 2022 at 4:18 pm
Look at the database diagram?
January 15, 2022 at 11:27 pm
Just saw a video from Chandoo (Excel MVP), right here. Watch the next to last section - the biggest game changer in Excel in the last year is PowerQuery,...
January 14, 2022 at 12:43 pm
Use sp_ForEachDB to loop over the DBs, and @@ROWCOUNT to collect the number of records affected/inserted?
I'd just create a counter variable and increment it after each insert. Then if you...
January 13, 2022 at 7:26 pm
LEFT(SourceString,4) & FORMAT(RIGHT(SourceString,2),"000")
?
January 9, 2022 at 2:43 am
Thanks for the update. It's pretty much what I expected to have to do... use something (PowerBI, Excel) to generate the PowerQuery and then copy and paste.
January 7, 2022 at 7:09 pm
What was the solution? I'd be interested to know, because I haven't used PowerQuery inside SSIS yet.
(Do you still have to write the PowerQuery in Excel or PowerBI and then...
January 6, 2022 at 3:14 pm
Viewing 15 posts - 421 through 435 (of 3,509 total)