I am converting Oracle queries to a SQL Server equivalent, some have been easier than others, right now I am stuck on a query that is containing this in a where clause
TRUNC(TO_NUMBER(TO_DATE(SYSDATE) - MyTable.DOBDATE) / 365, 0)
I've read that Convert is SQL Server's equivalent to ORACLE's TRUNC,
I know the SYSDATE will be GetDate() but I am lost on this part of the query
TRUNC(TO_NUMBER(TO_DATE(SYSDATE)
What would be SQL Server's equivalent to this ?
EDIT in short how do I take this Oracle statement
TRUNC(TO_NUMBER(TO_DATE(SYSDATE) - MyTable.DOBDATE) / 365, 0)
and convert to its SQL Server equivalent