There is a column in a SQL database (I'm working with SQL-SMT), the data looks like this:
Date
1021165435
1021215439
1021215441
1021162126
1021162122
1021212135
1021162137
1021212136
1021213136
For the first element, the purpose is to get something like: 21-10-2014 16:54:35 but I can't figure out how to do it, I already checked this post, but they use the '%' function, which according to SQL is incompatible with float and int. I sorted the code in this way:
select [Hora origen ] ,
nHora= convert(time ,
right( '0' + convert(varchar, [Hora origen] / 10000 ) , 2 )
+ ':'
+ right( '0' + (([Hora origen]-([Hora origen] % 100))% 10000)/100 , 2 )
+ ':'
+ right( '0' + convert(varchar, [Hora origen] % 10000 ) , 2 )
)
from Trx_tj$;
But still, it's not working