Wednesday, March 21, 2012

datetime procedure argument wont accept datetime value?

I am using Microsoft SQL Server Management Studio to connect to MSSQL 2005.... There is a stored procedure which has the following value amongst its parameters:

@.created_after datetime = null,

When I right-click the procedure and select Execute Stored Procedure, and enter a date like "23/01/2007 8:54:59 AM" into that field the following error is produced:

Msg 8114, Level 16, State 5, Procedure search, Line 0
Error converting data type nvarchar to datetime.
(1 row(s) affected)

As well as showing the following:

USE [FileStore]
GO

DECLARE @.return_value int

EXEC @.return_value = [dbo].[search]
@.created_after = N'23/01/2007 8:54:59 AM'

SELECT 'Return Value' = @.return_value

GO

Any idea why it will not accept my date value?

Any help would be appreciated ... Thank you :)

try input the datetime in universal format YYYYMMDD HH:MM:SS

Your system date format might not be DD/MM/YYYY|||You seem to be 100% correct! How can I change this?

No comments:

Post a Comment