OR
SELECT DATEDIFF(hh, '2005-03-28 10:00:00', '2005-03-28 13:00:00')
STAN
-----Original Message-----
From: Todorov Mihail
[mailto:mssqldba-ezmlmshield-x78216735.[Email address protected]
Sent: Wednesday, March 30, 2005 3:46 AM
To: LazyDBA Discussion
Subject: RE: Working only with time from a Date field
Juan,
Do you need something like this:
SELECT datepart( hh, cast( '2005-03-28 13:00:00' as datetime) - cast(
'2005-03-25 10:00:00' as datetime))
Best Regards,
Mihail Todorov
System Analyst
ICT Department
Kamenitza AD
-----Original Message-----
From: Juan le Roux
[mailto:mssqldba-ezmlmshield-x10149791.[Email address protected]
Sent: Wednesday, March 30, 2005 10:20 AM
To: LazyDBA Discussion
Subject: Working only with time from a Date field
Hi
I created a table that stores date fields, I must write functionality that
only gets the time differense between each date fields, not the day, here is
example:
date1 := 2005-03-25 10:00:00 and date2 := 2005-03-28 13:00:00
The result I want is in hours this would be: 3 hours, at the moment I am
getting the days included which is: 75 hours
Please help
Thanks
Juan
Juan Le Roux
Software Engineer
IFS Defence SA (Pty) Ltd
E-Mail: <<mailto:juan.[Email address protected]
Switchboard: +27-(0)12-663-5350 Fax: +27-(0)12-663-5370
Direct Tel: +27-(0)12-663-5350 Cell: +27-(0)83-670-7851
Web-Site: <<http://www.ifsdefence.com/>>
Address: P.O. Box 9984, Centurion, 0046, South Africa
DISCLAIMER NOTICE:
This e-mail and any associated files are confidential and intended only for
the addressee named above. If you are not the intended recipient or the
person responsible for delivering to the intended recipient, be advised that
you have received this email in error and you should delete it from your
system. Any views or opinions presented are solely those of the sender and
do not necessarily represent those of IFS Defence SA (Pty) Ltd unless
otherwise specifically stated. As internet communications are not secure we
do not accept legal responsibility for the contents of this message nor
responsibility for any change made to this message after it was sent by the
original sender. We advise you to carry out your own virus check before
opening any attachment, as we cannot accept liability for any damage
sustained as a result of any software viruses. If you have received this
email in error, or if you are concerned with its content or attachments,
please notify The IT Services Manager: lucio.[Email address protected]
---------------------------------------------------------------------
TO REPLY TO EVERBODY , PLEASE CLICK REPLY-ALL, NOT JUST REPLY Website :
http://www.LazyDBA.com To unsubscribe:
http://www.lazydba.com/unsubscribe.html
For additional commands, e-mail: mssqldba-[Email address protected]
---------------------------------------------------------------------
TO REPLY TO EVERBODY , PLEASE CLICK REPLY-ALL, NOT JUST REPLY
Website : http://www.LazyDBA.com
To unsubscribe: http://www.lazydba.com/unsubscribe.html
For additional commands, e-mail: mssqldba-[Email address protected]
MS Sql Server LazyDBA home page