Click here to monitor SSC
SQLServerCentral is supported by Redgate
Log in  ::  Register  ::  Not logged in
Home       Members    Calendar    Who's On

Add to briefcase

SQL query error Expand / Collapse
Posted Wednesday, March 6, 2013 6:57 AM


Group: General Forum Members
Last Login: Monday, October 10, 2016 5:25 AM
Points: 451, Visits: 1,079
select cast(COL1 as datetime) from TABLE where COL1<>'' and isdate(COL1) =1 and
cast(COL1 as datetime) < (DATEADD(YY, -3, GETDATE()))

above query gives the error
Msg 8115, Level 16, State 2, Line 1
Arithmetic overflow error converting expression to data type datetime.

Any idea why?
Post #1427362
Posted Wednesday, March 6, 2013 7:28 AM



Group: General Forum Members
Last Login: Yesterday @ 2:44 PM
Points: 16,134, Visits: 16,835
Duplicate post. direct replies here.


Need help? Help us help you.

Read the article at for best practices on asking questions.

Need to split a string? Try Jeff Moden's splitter.

Cross Tabs and Pivots, Part 1 – Converting Rows to Columns
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs
Understanding and Using APPLY (Part 1)
Understanding and Using APPLY (Part 2)
Post #1427392
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse