How to Find the Start and End Dates for the Current Week (and more)
Learn to calculate Start / First of Week, End of Week, Start of Next Week, Year, Quarter, and Month of the week, Week Numbers and more in T-SQL (Jeff Moden)
2022-07-13
33,665 reads
Learn to calculate Start / First of Week, End of Week, Start of Next Week, Year, Quarter, and Month of the week, Week Numbers and more in T-SQL (Jeff Moden)
2022-07-13
33,665 reads
In this tip we look at how to change specific parts of a date such as the Year, Month or Day for data stored in a SQL Server table.
2019-12-17
2017-11-20
645 reads
An inline table valued function (iTVF) that can be used to calculate age in years.
2016-04-27 (first published: 2016-04-06)
1,071 reads
Find minimum and maximum values for all date columns in a table or range of tables, using a mask.
2016-09-15 (first published: 2014-10-27)
3,051 reads
2013-03-11 (first published: 2013-02-20)
2,139 reads
Code to create a handy date calendar cross-reference table with a ton of pre-populated, slice-and-dice data field variations to aid in complex date parameterization / selection criteria.
2019-04-15 (first published: 2009-10-06)
16,828 reads
This function will return the first, second, third, fourth or last day of a given month.
2009-03-03 (first published: 2009-02-10)
1,186 reads
By Steve Jones
Today Redgate announced that we are partnering with Bregal Sagemount, a growth-focused private equity...
By Steve Jones
I used Claude to build an application that loaded data for me. However, there...
End-to-end NVMe vs SCSI testing over NVMe/TCP to a Pure Storage FlashArray: TPC-C and...
Good Evening, Is there a simpler way to rearrange the following WHERE condition: [Column_1]...
Comments posted to this topic are about the item Which Table I
Comments posted to this topic are about the item Using Python notebooks to save...
I have this code in SQL Server 2022:
CREATE SCHEMA etl;
GO
CREATE TABLE etl.product
(
ProductID INT,
ProductName VARCHAR(100)
);
GO
INSERT etl.product
VALUES
(2, 'Bee AI Wearable');
GO
CREATE TABLE dbo.product
(
ProductID INT,
ProductName VARCHAR(100)
);
GO
INSERT dbo.product
VALUES
(1, 'Spiral College-ruled Notebook');
GO
CREATE OR ALTER PROCEDURE etl.GettheProduct
AS
BEGIN
SELECT ProductName
FROM product;
END;
GO
When I execute this code as a user whose default schema is dbo and has rights to the tables and proc, what is returned? See possible answers