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
 Hours and Minutes Question

Author  Topic 

rpc86
Posting Yak Master

200 Posts

Posted - 2007-06-19 : 04:52:03
Hi guys,

how to get the Hours and Minutes ago?

I have a column name "DateCreated" which is a DateTime type. I need to get the Hours and Minutes ago

Thank you.

nr
SQLTeam MVY

12543 Posts

Posted - 2007-06-19 : 05:05:21
datediff(mi,DateCreated,getdate())/60
datediff(mi,DateCreated,getdate())%60


==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page
   

- Advertisement -