• Can you please elaborate?

    It will depend on what you want, calendar year to date, number of days

    select datediff(dd, '01/01/2005', getdate())

    The only date functions are.

    Function Description Example

    DATEDIFF( ) Calculates an interval between two dates. SELECT fname, lname, hire_date

    FROM employee

    WHERE DATEDIFF(year, hire_date, getdate()) > 5

    Locates all employees hired more than five years ago.

     

    DATEPART( ) Returns the specified portion of a date or datetime column, including the day, month, or year. SELECT DATEPART(year, hire_date)

    FROM employee

    Displays only the year in which an employee was hired (not the full date).

     

    CURDATE( )1,

    GETDATE( ) or DATE( ) Returns the current date in datetime format. This function is useful as input for many other date functions, such as calculating an interval forward or backward from today. SELECT order_id

    FROM orders

    WHERE order_date = GETDATE()

    Displays orders placed today.