SELECT year(date_column) as my_year FROM table_name;
In the above query, we have a table that has a date type column. When selecting this date type column we are only showing its date.
For example, If We have a table named Employee and it has a date type column Join_Date. To get the year from the Join_Date column we can use below MSSql Query.
SELECT
year(Join_Date) as join_year
FROM
Employee;
0 Comments