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
 Other Forums
 MS Access
 SQL Time Query

Author  Topic 

john_john
Starting Member

10 Posts

Posted - 2005-07-20 : 10:49:03
I'm trying to create an SQL Query that gives the difference of the time between two dates in a table. Can someone please help?

Sample table: X

Num DateA DateB
1 7/7/2005 7/5/2005
2 7/6/2005 7/5/2005


The result should be :

Num Diff
1 2 days
2 1 day

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-07-20 : 11:01:04
Select Num,DateDiff('D',DateB,DateA) from X

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -