When I create a date type in SQL, the result will come out like this 2012-2-1 Monday 00:00:00
However, I only want the year.
How can I get this?
Make an numeric field with just the year, or use the YEAR() function.
datetime, includes date and time, "date" just includes date formats.
select datepart(year,getdate())
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With