Table : "TableXYZ"
Column : "ColumnA"
User provides a value which is stored in variable "UserYear"
Needed Query : Select all fields from TableXYZ where year of columnA = UserYear
Query I came up with : select * from TableXYZ where year(columnA) = UserYear.
Query my boss want : He wants a query which does not have function on columnA to improve performance, so he wants something like
select * from TableXYZ where columnA = Date(useryear-month(columnA)-day(columnA))
Any suggestions how to achieve this..
Thanks in Advance
Column : "ColumnA"
User provides a value which is stored in variable "UserYear"
Needed Query : Select all fields from TableXYZ where year of columnA = UserYear
Query I came up with : select * from TableXYZ where year(columnA) = UserYear.
Query my boss want : He wants a query which does not have function on columnA to improve performance, so he wants something like
select * from TableXYZ where columnA = Date(useryear-month(columnA)-day(columnA))
Any suggestions how to achieve this..
Thanks in Advance