Viewing 15 posts - 16 through 30 (of 2,171 total)
Keep it simple
DECLARE @sample TABLE
(
...
N 56°04'39.16"
E 12°55'05.25"
March 15, 2023 at 9:26 pm
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...
N 56°04'39.16"
E 12°55'05.25"
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 (
...
N 56°04'39.16"
E 12°55'05.25"
March 2, 2023 at 6:32 pm
IF DATEPART(DAY, SYSDATETIME()) = 1 AND DATEDIFF(DAY, '19000101', SYSDATETIME()) % 7 = 6
BEGIN
EXEC dbo.WhatEver;
END;
N 56°04'39.16"
E 12°55'05.25"
January 5, 2023 at 10:24 pm
https://www.sqltopia.com/algorithms/date-and-time/jdedwards/
N 56°04'39.16"
E 12°55'05.25"
December 19, 2022 at 7:03 am
DECLARE @Sample TABLE
(
Account...
N 56°04'39.16"
E 12°55'05.25"
November 30, 2022 at 10:43 pm
You can substitute this simple GREATEST with a CASE WHEN THEN END statement.
N 56°04'39.16"
E 12°55'05.25"
November 23, 2022 at 7:59 pm
SELECT StudentId
FROM @student
GROUP BY ...
N 56°04'39.16"
E 12°55'05.25"
November 23, 2022 at 3:06 pm
-- swePeso solution
WITH cteData(StudentId, delta, rnk)
AS (
SELECT StudentId,
...
N 56°04'39.16"
E 12°55'05.25"
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...
N 56°04'39.16"
E 12°55'05.25"
November 15, 2022 at 8:25 pm
https://www.sqltopia.com/algorithms/date-and-time/get-the-nth-weekday-of-any-interval/
N 56°04'39.16"
E 12°55'05.25"
November 15, 2022 at 4:38 pm
September 14, 2022 at 1:28 pm
SELECT fcustno,
fnamount,
finvdate
FROM dbo.armast
WHERE fcustno...
N 56°04'39.16"
E 12°55'05.25"
August 26, 2022 at 7:51 pm
What about the dimensions not in the fact table?
SELECT a1.businessid,
...
N 56°04'39.16"
E 12°55'05.25"
August 26, 2022 at 5:12 pm
Something like this?
WITH cteAggregated(CustomerID, ItemID, Yak)
AS (
...
N 56°04'39.16"
E 12°55'05.25"
May 31, 2022 at 2:17 pm
Viewing 15 posts - 16 through 30 (of 2,171 total)