Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

conversion of char data type to a datetime data type

Status
Not open for further replies.

peterempson

Technical User
Dec 28, 2004
4
GB
My report uses a sql stored procedure. Works fine in sql 2000 but when adding it to the report receiving the error:

ODBC error:[Mocrosoft][ODBC SQL Server Driver] The conversion of char data type to a datetime data type resulted in an-out of ranged datetime value.

the line in the stored procedure causing the problem is as follows;

INSERT INTO temp_whereabouts VALUES (@pa_number, @street_number, @street_entry,cast(cast(year(@street_entry) as varchar)+'-'+cast(month(@street_entry) as varchar)+'-'+cast(day(@street_entry) as varchar)+' 23:59' as datetime))

any ideas how to fix it?
 
There's a forum for SQL programming; that would be a better place to ask. (You should be able to find it quickly by clicking on my ID, which will show you everything I've joined.)

[yinyang] Madawc Williams (East Anglia, UK) [yinyang]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top