13
Answers

Arithematic overflow error converting expression to int

nijisha k c

nijisha k c

9y
562
1
following is my query in sql 2005.But iam getting an error like arithmetic overflow error converting expression to data type int .
I think it is related to dateadd() function.Because when i put a sample date ,this query works well.
 
This is my query.
 
select tb_batch.batch_number, dateadd(s, tb_batch.exp_date,'1970-01-01')as exp_date,
tb_batch.purchase_rate, tb_batch.sale_rate from tb_batch

And This is the error

Msg 8115, Level 16, State 2, Line 1
Arithmetic overflow error converting expression to data type int.

Here datatype of exp_date is bigint

pls help me to solve this.
Answers (13)