Extract Date Parts Without Using Date Functions in SQL | Easy Technique | SQL

preview_player
Показать описание
In this video we will see how to extract date parts from date column without using a date function in SQL.

Рекомендации по теме
Комментарии
Автор

using convert with text based functions

select
BirthDate,
SUBSTRING(CONVERT(varchar(10), BirthDate, 120), 1, 4) as BirthYear,
SUBSTRING(CONVERT(varchar(10), BirthDate, 120), 6, 2) as BirthMonth,
SUBSTRING(CONVERT(varchar(10), BirthDate, 120), 9, 2) as BirthDay
from Employees_2024

madhusudhanreddyt
join shbcf.ru