I'm working with a database where dates are stored as 10 digit integers and where the user can query information within certain calendar date ranges. I was wondering what are the steps for converting a calendar date to a 10 digit integer for comparison with dates stored in a database.
I'm working with sql server 2000.
You need SELECT DATEADD(second, 1240494225, '19700101') to convert the number to a date and SELECT DATEDIFF(second, '19700101', @some_date) to go the other way.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With