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.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 How to retrieve time span??

Author  Topic 

phrankbooth
Posting Yak Master

162 Posts

Posted - 2007-09-18 : 19:02:51
Hello,

Some advice appreciated on the following, thanks!
I have this query:
select field1, field2, astartdate, anenddate
from atable
where astartdate BETWEEN '9/11/2007 12:00:00 AM' AND '9/18/2007 11:59:59 PM'

I need the results to be like the following:
field1,field2,anenddate-astartdate <<that's minus

Thank you for the help!
--PhB


--PhB

ValterBorges
Master Smack Fu Yak Hacker

1429 Posts

Posted - 2007-09-18 : 19:09:38
http://www.sqlteam.com/article/datediff-function-demystified

http://www.tek-tips.com/faqs.cfm?fid=5842

Go to Top of Page
   

- Advertisement -