I store the long values in mssql using bigint so I could do something like this:
--@start and @end are bigint
set @duration = @start - @end
now I need some additional operation so I could get the duration in seconds, anybody knows how ?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I guess it really depends on what those values were .. you say Java long, so it makes me wonder if you’re doing something like System.currentTimeMillis() and then shoving that value in the database. If that’s the case, then just dividing the duration by 1,000 would get you seconds.
More information in the question would be helpful.