Viewing 15 posts - 1 through 15 (of 2,926 total)
So you create a statement on top of what you have and then get an average of the datediff results.
AFAIK, you'd have to roll your own median function. I'm sure...
January 26, 2021 at 6:15 am
Could you post some sample data and expected results?
I'd use a Calendar table for this kind of thing.
January 25, 2021 at 10:34 pm
As it wasn't my database, I would assume FIFO, but then I could be wrong. <g>
Frederico, any pointers on how to do it without a cursor? The only way I...
January 24, 2021 at 7:44 pm
Correct me if I'm wrong, but if I'm processing a series of work orders for products I need to build, then the only way to do it seems to be...
January 23, 2021 at 11:15 pm
This gets the "new" customers. Then you'd just join this back to the Transactions/Sales table and do a simple sum.
SELECT CustomerID
FROM Customer c
WHERE NOT EXISTS (SELECT 1
FROM...
January 20, 2021 at 2:25 am
Thanks... I think I'm going to read Itzik's book and watch some of Kendra Little's T-SQL courses on indexing and querying.
(Good time to have a normal job where people come...
January 18, 2021 at 8:56 pm
Like this?
SELECT ct.[NAME]
, SUM(ct.c_Imaging) AS Imaging
, SUM(ct.c_Long_Term) AS Long_Term
, SUM(ct.c_Factory) AS Factory
, SUM(ct.c_Central_Office) AS Central_Office
, SUM(ct.c_Pizza) AS Pizza
FROM
(SELECT ID
, [Name]
, CASE WHEN [Type] = 'Imaging' THEN [Count]...
January 13, 2021 at 2:07 am
I think you can grab the creation date of the file if you use a folder object and iterate over the files in PowerQuery. Then you could just remove the...
January 11, 2021 at 10:09 pm
Did you read this yet?
Cross Tabs and Pivots, Part 1 – Converting Rows to Columns – SQLServerCentral
January 9, 2021 at 11:51 pm
You can insert the results of a stored procedure into a temporary table pretty easily
SELECT *
INTO #TempResult
FROM
(SELECT store, [week], xCount
FROM yt) AS sourceTable
PIVOT
(
SUM(xCount)
FOR [week] in ([1],[2],[3],[4],[5],[6])
)...
January 8, 2021 at 3:35 am
Because order is not guaranteed without using an ORDER BY clause? This is SQL 101!
January 6, 2021 at 2:19 am
Wait... something's not right. Your test cases are imcomplete.
Looks like you want to group by PartID, CompanyID... then get a count
Something like
SELECT *
FROM #PartsData pd
WHERE partID IN...
January 1, 2021 at 1:26 am
If you're using full recovery mode, restore up to just before you ran that query?
December 27, 2020 at 9:28 am
Show us your attempt. =)
SELECT BusinessKey
.name
,attribute
,MIN(ValidFrom)
...
December 15, 2020 at 6:32 pm
Jeff,
Yes, I did that... Found a bunch of stuff from IBM's website. Not much of it is terribly helpful, though. That's why I was asking here. There's a little on...
December 12, 2020 at 12:12 am
Viewing 15 posts - 1 through 15 (of 2,926 total)