Click here to Skip to main content
15,893,923 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
How come:

SELECT CURRENT_TIMESTAMP - 5 as [Subtract 5 what?]

yields the current date/time - 5 days?

Based on the documentation I would expect it to subtract 5 'ticks.'
Posted

1 solution

You could have easily checked this by running the query
SELECT CURRENT_TIMESTAMP, CURRENT_TIMESTAMP - 5
and comparing the results

"The Transact-SQL timestamp data type is not the same as the timestamp data type defined in the SQL-92 standard. The SQL-92 timestamp data type is equivalent to the Transact-SQL datetime data type"

http://msdn.microsoft.com/en-us/library/aa260631(SQL.80).aspx[^]

So the answer is days, not ticks
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900