Hello,I am having a problem with a function I'm trying to create.Basically because of problems with dates and return values of stored procedures having to be an int, I'm trying to pass a date back in ticks as opposed to the actual date.I've found a function that will convert the date value into the number of ticks (see link), but for some reason I am getting the following error when I try to use it in my function:Link = [url]http://www.codeproject.com/KB/database/DateTimeToTicks.aspx[/url]"Error 116: only one expression can be specified in the select list when the subquery is not introduced with EXISTS"The code in my function is as follows :CREATE FUNCTION dbo.fn_YearBreakdownDateFrom (@Date datetime) RETURNS floatASBEGIN DECLARE @RetVal datetime DECLARE @ConvertedDate float SET @RetVal = (SELECT DateFrom FROM dbo.tbl_YearBreakdown WHERE (DateFrom <= CONVERT(DATETIME, @Date, 103)) AND (DateTo >= CONVERT(DATETIME, @Date, 103))) SET @ConvertedDate =(SELECT @RetVal, dbo.fn_DateToTicks(@RetVal)) RETURN @ConvertedDateEND
Can anyone help please ?