Hi,
i need to find the differance between 2 dates, but need the difference output as days or weeks or months etc depending on a set of criteria.
getting the difference is easy, BUT DO YOU KNOW HOW TO PASS THE 'DATEPART' PART OF THE FUNCTION AS A VARIABLE ??
If i try this i get the following error :
SELECT DATEDIFF(@x, date_SODue, getdate()) AS no_of_days
"Invalid parameter 1 specified for datediff."
thanks
i need to find the differance between 2 dates, but need the difference output as days or weeks or months etc depending on a set of criteria.
getting the difference is easy, BUT DO YOU KNOW HOW TO PASS THE 'DATEPART' PART OF THE FUNCTION AS A VARIABLE ??
If i try this i get the following error :
SELECT DATEDIFF(@x, date_SODue, getdate()) AS no_of_days
"Invalid parameter 1 specified for datediff."
thanks