-1

I am trying to enter date only in year format if I use short as datatype it's still a waste of data. I hope there must be some function or something to achieve this.

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459

1 Answers1

1

Just use smallint (Short). Size your data type properly, a two byte int is a better choice. By storing 4 digit years in 4 bytes, you are wasting more resources than just disk space.

For extracting year only use

YEAR(Date) function
S M
  • 3,133
  • 5
  • 30
  • 59