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
 date difference

Author  Topic 

esambath
Yak Posting Veteran

89 Posts

Posted - 2008-11-24 : 07:05:00
Hi Friends,

Please help this one
I have one table name MDB_Pay_myVideo

Fields

MyVideoId
VideoId
UserId
DateOfPayment
Status
Deleted
CreationDateTime
ModifiedDateTime

MyVideoId VideoId UserId DateOfPayment Status Deleted CreationDateTime
1 1 2 2008-06-11 00:00:00.000 1 0 2008-06-11 00:00:00.000 2008-06-11 00:00:00.000
2 1 3 2008-06-11 00:00:00.000 1 0 2008-06-11 00:00:00.000 2008-06-11 00:00:00.000
3 3 2 2008-06-12 00:00:00.000 1 0 2008-06-12 00:00:00.000 2008-06-12 00:00:00.000
4 2 1 2008-06-12 00:00:00.000 1 0 2008-06-12 00:00:00.000 2008-06-12 00:00:00.000
5 3 19 2008-11-12 00:00:00.000 0 0 2008-11-12 00:00:00.000 2008-11-12 00:00:00.000
6 1 2 2008-11-17 16:42:26.077 1 0 2008-11-17 16:42:26.077 2008-11-17 16:42:26.077
7 6 19 2008-11-18 16:33:02.733 1 0 2008-11-18 16:33:02.733 2008-11-18 16:33:02.733


I have the query DateOfPayment diff between current date 24 hours

Thanks and Regards
E.sambath kumar

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-11-24 : 07:09:11
[code]select * from MDB_Pay_myVideo where DateOfPayment>= DATEADD(hh,-24,GETDATE()) AND DateOfPayment<= GETDATE()[/code]
Go to Top of Page
   

- Advertisement -