SQL Server Error?

I have a stored procedure that I'm trying to compile and I keep getting this error message:

"Implicit conversion from data type datetime to smallint is not allowed. Use the CONVERT function to run this query."

Here is the SP:

ALTER PROCEDURE [dbo].[spAddUpdate_HEADER_Equipment]
	@returnValue			INT=NULL,
	@equipment_ID			INT=NULL,
	@equipmentName_ID		INT=NULL,
	@equipmentType_ID		INT=NULL,
	@department_ID			INT=NULL,
	@calibrationHouse_ID	INT=NULL,
	@extensionDate			DATETIME=NULL,
	@calibrationDate		DATETIME=NULL,
	@nextCalibrationDate	DATETIME=NULL,
	@combinedUncertainty	DECIMAL(18,9)=NULL,
	@coverageFactor			DECIMAL(18,9)=NULL,
	@serialNO				VARCHAR(50)=NULL,
	@description			VARCHAR(250)=NULL,
	@traceabilityNO			VARCHAR(50)=NULL,
	@interval_ID			INT=NULL,
	@active					INT=NULL,
	@accredited				INT=NULL,
	@createdBy_ID			INT=NULL,
	@updatedBy_ID			INT=NULL,
	@approvedBy_ID			INT=NULL
AS
BEGIN

	IF EXISTS (SELECT equipment_ID FROM HEADER_Equipment WHERE equipment_ID = @equipment_ID)
		BEGIN
			UPDATE	HEADER_Equipment
			   SET	interval_ID = @interval_ID
					,department_ID = @department_ID
					,calibrationHouse_ID = @calibrationHouse_ID
					,calibrationDate = @calibrationDate
					,nextCalibrationDate = @nextCalibrationDate
					,extensionDate = @extensionDate
					,[description] = @description
					,traceabilityNO = @traceabilityNO
					,combinedUncertainty = @combinedUncertainty
					,coverageFactor = @coverageFactor
					,serialNO = @serialNO
					,active = @active
					,accredited = @accredited
					,updatedBy_ID = @updatedBy_ID
					,dateUpdated = GETDATE()
					,approvedBy_ID = @approvedBy_ID            --Receiving the Error on this line
			 WHERE	equipment_ID = @equipment_ID
			 
			 SET @returnValue = @equipment_ID
		END
	ELSE
		BEGIN
			INSERT INTO HEADER_Equipment
				(equipmentName_ID
				 ,equipmentType_ID
				 ,department_ID
				 ,calibrationHouse_ID
				 ,calibrationDate
				 ,nextCalibrationDate
				 ,extensionDate
				 ,[description]
				 ,traceabilityNO
				 ,combinedUncertainty
				 ,coverageFactor
				 ,interval_ID
				 ,serialNO
				 ,active
				 ,accredited
				 ,createdBy_ID
				 ,dateCreated
				 ,updatedBy_ID
				 ,dateUpdated
				 ,approvedBy_ID)
			 VALUES
				(@equipmentName_ID
 				 ,@equipmentType_ID
				 ,@department_ID
				 ,@calibrationDate
				 ,@nextCalibrationDate
				 ,@extensionDate
				 ,@calibrationHouse_ID
				 ,@description
				 ,@traceabilityNO
				 ,@combinedUncertainty
				 ,@coverageFactor
				 ,@interval_ID
				 ,@serialNO
				 ,@active
				 ,@accredited
				 ,@createdBy_ID
				 ,GETDATE()
				 ,@updatedBy_ID
				 ,GETDATE()
				 ,@approvedBy_ID)

			SET @returnValue = @@IDENTITY
		END	
	
	RETURN @returnValue
END

Open in new window

BlakeMcKennaAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Kyle AbrahamsSenior .Net DeveloperCommented:
On the insert portion your missing

@calibrationHouse_ID


before @calibrationDate
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
BlakeMcKennaAuthor Commented:
Wow...that was it. Was deceiving in it's location....

Thanks!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Development

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.