Category: Development

TSQL – Find Rows Where Column Value is Between 2 Dates (or Other Values)

If you are looking to find rows with a column value between 2 dates, "BETWEEN" is what you are looking for. Syntax test_expression [ NOT ] BETWEEN begin_expression AND end_expression Example SELECT * FROM <Example_Table> WHERE TheDateField BETWEEN '2018-05-15' AND '2018-07-01' If just dates are specified, the time starts at 12:00AM. Helpful related links: Using … Continue reading TSQL – Find Rows Where Column Value is Between 2 Dates (or Other Values)