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.
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.
Upendra Pratap ShahiPosted Aug 5, 2015, 2:30 AM
Jignesh TrivediPosted Aug 5, 2015, 12:08 AM
Hi,
syntax of DateAdd is DATEADD(interval, increment int, date)
This is because of increment element of DateAdd is accept int value and you pass bigint value.
instead of doing this first convert second to hour or day and pass hour or day in this function. this will resolved your problem
hope this will help you.
nijisha k cPosted Aug 4, 2015, 6:29 AM
Amitesh VermaPosted Aug 4, 2015, 6:25 AM
nijisha k cPosted Aug 4, 2015, 6:22 AM
Amitesh VermaPosted Aug 4, 2015, 6:20 AM
nijisha k cPosted Aug 4, 2015, 6:18 AM
Amitesh VermaPosted Aug 4, 2015, 6:17 AM
nijisha k cPosted Aug 4, 2015, 6:15 AM
Amitesh VermaPosted Aug 4, 2015, 6:10 AM
Amitesh VermaPosted Aug 4, 2015, 6:09 AM
nijisha k cPosted Aug 4, 2015, 6:05 AM
Amitesh VermaPosted Aug 4, 2015, 6:03 AM