Site Sponsored By: SQLDSC - SQL Server Desired State Configuration
Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
I have 2 datetime type variables, and I want sql server to tell me how many days they differ.D1 = 2007-06-01 D2 = 2007-06-15result of D2-D1 should be 14 daysThanks in advance for any help!
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts
Posted - 2007-07-06 : 11:46:07
Did you take any efforts to go through SQL Server help at all?
select Datediff(day, @d1, @d2) as Days
Harsh AthalyeIndia."The IMPOSSIBLE is often UNTRIED"