Answer the question
In order to leave comments, you need to log in
How to extract records by T-SQL date range?
Microsoft Documentation:
https://docs.microsoft.com/ru-ru/sql/t-sql/languag...
Quote:
The following example returns rows where datetime values are between '20011212' and '20020105' inclusive.
SELECT BusinessEntityID, RateChangeDate
FROM HumanResources.EmployeePayHistory
WHERE RateChangeDate BETWEEN '20011212' AND '20020105';
SELECT * FROM [Таб1]
WHERE ([Id] = '10') AND ([Дата] BETWEEN '2020-11-09 00:00:00.000' AND '2020-10-10 00:00:00.000')
Answer the question
In order to leave comments, you need to log in
The date representation depends on the settings.
SELECT * FROM [Таб1]
WHERE ([Дата] BETWEEN '20201109' AND '20201010')
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question