Nordest,
There is no direct function and it depends on what you want...
If you wish to use a SELECT to return all records for the year of the current date to the current date, this automatically works every time...
SELECT yada-yada
FROM yourtable
WHERE somedatefield >= DATEADD(yy,DATEDIFF(yy,0,GETDATE()),0)
If you wish to find the number of days in for YTD, this will work nicely...
SELECT DATEPART(dy,GETDATE())
Your request was a bit vague as to which type of YTD function you wanted. If you want a SUM or a COUNT of something, post back. It would be good include table schema and some sample data in the form of insert statements for the quickest help.
--Jeff Moden
Change is inevitable... Change for the better is not.