Viewing 15 posts - 1 through 15 (of 1,440 total)
This is a similar query that might perform differently. You need to test
SELECT i.ItemID
, i.ItemName
...
January 22, 2025 at 11:52 am
It is difficult to design any queries without knowing anything about your tables and their indexes.
That said, this might help.
SELECT i.ItemID
, i.ItemName
...
January 22, 2025 at 11:44 am
You could do something like this
SELECT src.AssessmentCode, src.AssessmentDescriptio, m.Mark
FROM YourSchema.YourTable AS src
CROSS JOIN (VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10)) AS m(Mark)
January 22, 2025 at 11:34 am
Based on your provided sample data, this query will produce the correct result.
WITH cteCrossTab AS (
/* Use a Cross-Tab query to get the data in...
January 17, 2025 at 9:57 am
Based on your provided sample data, this query will produce the correct result.
WITH cteBase AS (
SELECT t0.*, rn = ROW_NUMBER() OVER (PARTITION BY t0.uniqueid, t0.[level]...
January 16, 2025 at 9:44 am
Without test data we are just guessing.
Maybe this will do the trick
DECLARE @SearchDate date = CONVERT(date, '12/29/2024', 101);
SELECT *
FROM DueDates
WHERE CONVERT(date, textDate , 1) > @SearchDate
ORDER BY...
January 1, 2025 at 5:18 am
Maybe your "date" needs quotes
CONVERT(date, textDate , 1) > CONVERT(date, 'mm/dd/yy', 1)
January 1, 2025 at 4:43 am
You can convert it to a date/datetime with
CONVERT(date, '12/31/24', 1)
December 31, 2024 at 4:44 pm
Correct. However (IT DEPENDS), there are times when a variable will not be updated using ISNULL. That is why it is sometimes necessary to use the other syntax. In the...
December 30, 2024 at 12:23 pm
Either below; the first is more typical:
DECLARE @LATEST_DATE DATE;
SELECT @LATEST_DATE = MAX(MY_DATE) FROM DBO.TABLE
--or:
SET @LATEST_DATE = (SELECT MAX(MY_DATE) FROM DBO.TABLE);
I generally use the 2nd version of...
December 27, 2024 at 5:38 am
I would look at "forcing" the overlap. This can be achieved by applying an extra CTE at the start of the above code
WITH ForcedOverlap AS (
...
December 6, 2024 at 12:46 pm
You dont show your expected output.
Maybe this will point you in the right direction
WITH cteLag AS (
SELECT lt.Number
...
December 4, 2024 at 6:01 am
This code illustrates how AT TIME ZONE automatically caters for DST
DECLARE @Data table (
MyTimeUTC datetime
);
INSERT INTO @Data ( MyTimeUTC )
VALUES ( '2024-05-01 00:31:15' )
...
November 20, 2024 at 6:07 am
I am having difficulty understanding what you are trying to achieve. Maybe some sample data and expected results will help.
That said, I suspect that your design is going to fall...
November 20, 2024 at 5:46 am
Viewing 15 posts - 1 through 15 (of 1,440 total)