Viewing 15 posts - 916 through 930 (of 3,500 total)
So you just slap a CREATE VIEW on the front and list the columns you want to return. Only catch is that you can't use ORDER BY in a view.
August 25, 2019 at 7:51 pm
This appears to work... but my eyesight is terrible, so test it:
SELECT Party
, EIDs = STUFF((
...
August 22, 2019 at 1:35 pm
If you're doing this in PowerBI, don't you want a measure that calculates a count, like COUNTROWS('FactTable') and then use CALCULATE() to modify the evaluation context?
Here's an example of doing...
August 13, 2019 at 2:01 am
Okay, this one really works... Maybe my brain is taking the weekend off...
First things first, we need some data (CREATE TABLE and INSERT scripts)
use tempdb;
GO
CREATE TABLE #Sales...
August 11, 2019 at 10:18 pm
Like this?
Note: if you provide readily consumable data (create table and insert scripts), you're far more likely to get a tested answer.
-- STEP 1: set up some...
August 10, 2019 at 2:13 pm
Got some sample data? That would help a LOT.
August 9, 2019 at 6:40 pm
Looks like this works. Here's some data... this is what Jeff is talking about... readily consumable data (CREATE TABLE and INSERT SCRIPTS.)
use tempdb;
go
-- set up your table
CREATE...
August 9, 2019 at 6:10 pm
Try utteraccess.com
In spite of the name, they discuss all MS Office stuff there.
August 8, 2019 at 7:50 pm
Does 'GetAllFavoriteItems' exist in your current restored database? Sounds like it can't find it.
August 8, 2019 at 3:16 pm
Why the DISTINCT?
where ID in
(
select distinct ID from SourceDB.dbo.Table2 where CreateDateTime<@CutOffPeriod)
Doesn't matter if there are duplicates in the list you're matching to. DISTINCT is expensive. Use it only when you...
August 7, 2019 at 10:32 pm
I got it to work, but I flat out cheated. I used Access (which most everyone here hates), but it was the easiest solution for me.
I created a table in...
August 6, 2019 at 10:17 pm
You should be able to do this (create calculated columns) inside SSRS... or are you not using SSRS?
August 5, 2019 at 11:42 pm
Totally forgot about STRING_AGG()
SELECT SUM(Qty) AS Counted
, Article
, STRING_AGG(Color,', ') AS Colors
FROM Things
GROUP BY Article;
August 5, 2019 at 3:55 pm
I don't think so. I couldn't get the concatenation of Colors to work without FOR XML.
SELECT SUM(Qty) AS 'Counted'
, ColorGrp.Article
, ColorGrp.Colors
FROM
(SELECT Article
, STUFF((SELECT ', ' +...
August 5, 2019 at 3:26 pm
Viewing 15 posts - 916 through 930 (of 3,500 total)