Viewing 15 posts - 16 through 30 (of 2,169 total)
Are you sure? I am summing at the lowest level, converting hours to minutes.
Then I am reverting the sum back to hours and minutes (for the sample data 29 hours...
March 2, 2023 at 7:10 pm
DECLARE @sum INT;
SELECT @sum = 60 * SUM(CAST(PARSENAME(REPLACE(x, ':', '.'), 2) AS INT)) + SUM(CAST(PARSENAME(REPLACE(x, ':', '.'), 1) AS INT))
FROM (
...
March 2, 2023 at 6:32 pm
IF DATEPART(DAY, SYSDATETIME()) = 1 AND DATEDIFF(DAY, '19000101', SYSDATETIME()) % 7 = 6
BEGIN
EXEC dbo.WhatEver;
END;
January 5, 2023 at 10:24 pm
You can substitute this simple GREATEST with a CASE WHEN THEN END statement.
November 23, 2022 at 7:59 pm
SELECT StudentId
FROM @student
GROUP BY ...
November 23, 2022 at 3:06 pm
-- swePeso solution
WITH cteData(StudentId, delta, rnk)
AS (
SELECT StudentId,
...
November 23, 2022 at 6:47 am
Because if you care about performance, you want to avoid IO.
Calculating "next wednesday" is about 150 times faster than looking it up (using ta table) on just a few million...
November 15, 2022 at 8:25 pm
September 14, 2022 at 1:28 pm
SELECT fcustno,
fnamount,
finvdate
FROM dbo.armast
WHERE fcustno...
August 26, 2022 at 7:51 pm
What about the dimensions not in the fact table?
SELECT a1.businessid,
...
August 26, 2022 at 5:12 pm
Something like this?
WITH cteAggregated(CustomerID, ItemID, Yak)
AS (
...
May 31, 2022 at 2:17 pm
SELECT data,
CONVERT(CHAR(10), CAST(SUBSTRING(data, 18, 8) AS DATETIME), 105) + ' ' + SUBSTRING(data, 27, 2) + ':' +...
June 8, 2021 at 4:28 pm
Viewing 15 posts - 16 through 30 (of 2,169 total)