Create a field in Table Colum:- tbl_inst_install_date Data Type -----varchar(50) Date 03/02/2016
No, I want to Convert this Colum Date from 03/02/2016 to 2016 (dd/mm/yyyy) To (YYYY)
Kindly Advise us
Create a field in Table Colum:- tbl_inst_install_date Data Type -----varchar(50) Date 03/02/2016
No, I want to Convert this Colum Date from 03/02/2016 to 2016 (dd/mm/yyyy) To (YYYY)
Kindly Advise us
Hi @SAQ-5842,
Welcome to Microsoft Q&A!
Please refer below:
select year(cast(yourcolumn as date)) from yourtable
select format(cast(yourcolumn as date),'yyyy') from yourtable
select right(yourcolumn,4) from yourtable
Best regards,
Melissa
If the answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
16 people are following this question.
Year and Month aggregation in same Pivot table in SQL Server
SQL Server Query for Searching by word in a string with word breakers
How to show first row group by part id and compliance type based on priorities of Document type?
Query to list all the databases that have a specific user
T-sql query to find the biggest table in a database with a clustered index