I have a situation where I am getting the following error:Msg 241, Level 16, State 1, Line 8Conversion failed when converting datetime from character string.The query worked fine before the CASE statement was added so any assistance is appreciated (see code below)!!!Go Declare @Previous_Start_Date datetime, @Previous_End_Date datetime, @Current_Start_Date datetime, @Current_End_Date datetimeSet @Previous_Start_Date = '20090101'Set @Previous_End_Date = '200901231 23:59:59' Set @Current_Start_Date = '20100701'Set @Current_End_Date = '20101231 23:59:59' SELECT A.Group_Formal_Name, A.Group_Informal_Name, A.Group_Code, E.LUV_Desc, H.Process_Date, H.Batch_Amount, F.Allocation_Amt,CASE WHEN F.Fund_ID = '32966552-A5C5-4FC4-A001-4BE0B968DB15' THEN 'Hope Gift' ELSE 'General' END AS Fund,CASE WHEN H.Process_Date between @Previous_Start_Date and @Previous_End_Date THEN 'Y' ELSE 'N' END AS CY2009,CASE WHEN H.Process_Date between @Current_Start_Date and @Current_End_Date THEN 'Y' ELSE 'N' END AS CalYrFROM Per_Group_Loc A INNER JOIN Payment_Device B ON B.Payor_Code = A.Group_Code INNER JOIN Payment_Device_History C ON C.Pay_Device_ID = B.Pay_Device_ID INNER JOIN Payment D ON D.Payment_ID = C.Payment_ID INNER JOIN Payment_Allocation F ON F.Payment_ID = D.Payment_ID INNER JOIN Payment_Batch H ON H.Batch_ID = D.Batch_ID and H.Process_Date between @Previous_Start_Date and @Current_End_DateINNER JOIN LookUpValues E ON E.LUV_ID = A.Group_Type_CodeWHERE F.Allocation_Amt > 0 ANDA.Group_Code <> '50067550' andF.Fund_ID IN ('32966552-A5C5-4FC4-A001-4BE0B968DB15','FE5DCA9C-2B8C-4DFE-8805-EA8604EDA19A')ORDER BY A.Group_Formal_Name
Phil