I have a members table with field DataNa type date.
I would like to make a query like:
Select DateDiff (year, datana, dateserial (year,12,31)) as years, ....
from members ... etc ...
Year is a parametric value. But the system tells me that DateSerial is not a recognized value of default function name.
I also tried to do:
Select DateDiff (year, datana, datevalue ('31/12/' + year)) as years, ....
from members ... etc ...
It says it also is not a DateValue recognized default function name
I'm using SQL Server 2008R2