Avatar of zimmer9
zimmer9
Flag for United States of America asked on

How do I resolve the following error using SQL Server 2008 "Invalid parameter 1 specified for datediff"?

How do I resolve the following error using SQL Server 2008?

dtCreated has a data type of datetime and has a value such as "2009-08-03 00:00:00.000"

Msg 1023, Level 15, State 1, Procedure proc_CSL_UnresolvedRequests, Line 3
Invalid parameter 1 specified for datediff.
Msg 1023, Level 15, State 1, Procedure proc_CSL_UnresolvedRequests, Line 5
Invalid parameter 1 specified for datediff.
Msg 1023, Level 15, State 1, Procedure proc_CSL_UnresolvedRequests, Line 7
Invalid parameter 1 specified for datediff.

USE [CSL]
GO
/****** Object:  StoredProcedure [dbo].[proc_CSL_DistinctEntity]    Script Date: 09/23/2016 17:42:33 ******/
SET ANSI_NULLS OFF
GO
SET QUOTED_IDENTIFIER OFF
GO
ALTER PROCEDURE [dbo].[proc_CSL_UnresolvedRequests]
AS
SELECT revID,dtCreated, 'ReversePositive', createdBy, datediff("d", dtcreated,getdate())
FROM tbl_CSL_Reversepositive where _status='Not Completed'
UNION SELECT stopID, dtCreated,'StopPayment/VoidCheck',createdBy, datediff("d", dtcreated,getdate())
FROM tbl_CSL_Stopvoidpay where _status='Not Completed'
UNION SELECT undeliverID, dtCreated, 'UndeliverableChecks',createdBy, datediff("d", dtcreated,getdate())
FROM tbl_CSL_Undeliverablechecks where _status='Not Completed'
Microsoft SQL ServerMicrosoft SQL Server 2008

Avatar of undefined
Last Comment
Ryan Chong

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Ryan Chong

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23