SQL SELECT ERRO ARITHMETIC

17 Views Asked by At

I want convert a datetime to milliseconds since 1970-01-01, but my conversion is overflow than integer in select.

But SQL Server return error :

Arithmetic overflow error converting numeric to data type int

I try this :

Select  CAST(DATEDIFF(second,'1970-01-01 00:00:00','2023-01-01 00:00:00')*10000000+116444736000000000 AS BIGINT)

It's not possible to use the tampory variable for set this, because I want Insert the select in another table.

Where is the parameter to limit value in select ?

0

There are 0 best solutions below