SQL Date Parsing Error
I am writing some SQL to pull data from our AS400 here at work. I was getting the error "Arithmetic overflow error converting expression to data type datetime." from the following code where date_column contained a date formatted like 20080930:
1 year(date_column)
At first, I thought there was some bad data in the column. It turns out, the datatype was int as opposed to varchar like I had assumed. This fixed it:
1 year(cast(date_column as varchar(8)))
TweetBacks

There are no comments for this entry.
[Add Comment] [Subscribe to Comments]