Calculating the Time length
-
Hi everyone. pls help,I am busy with the security access system which monitores arrival ,lunch and depature time,so I need to calculate the time length eg my table looks like this: Date Name TimeIN TimeOUT Length 12/2/2007 Myself 7:45 12:00 4:55 so how do I calculate that 4:55 which is the difference of TImeIN and TimeOUT,I need a sql statement or any calculation methods to do that. Thanks in advance.
-
Hi everyone. pls help,I am busy with the security access system which monitores arrival ,lunch and depature time,so I need to calculate the time length eg my table looks like this: Date Name TimeIN TimeOUT Length 12/2/2007 Myself 7:45 12:00 4:55 so how do I calculate that 4:55 which is the difference of TImeIN and TimeOUT,I need a sql statement or any calculation methods to do that. Thanks in advance.
-
Hi everyone. pls help,I am busy with the security access system which monitores arrival ,lunch and depature time,so I need to calculate the time length eg my table looks like this: Date Name TimeIN TimeOUT Length 12/2/2007 Myself 7:45 12:00 4:55 so how do I calculate that 4:55 which is the difference of TImeIN and TimeOUT,I need a sql statement or any calculation methods to do that. Thanks in advance.
-
Hope this helps
DECLARE @dd AS datetime SET @dd =(SELECT convert(datetime,TimeOUT) - convert(datetime,TimeIN)) SELECT convert(varchar,@dd,108) AS minutes
thanks,but is still not working because the datatype of TimeIN and TimeOUT is Nvarchar not datetime,I did that because I wanted to insert them as DateTime.Now.ToShortDateString();so how will I manage to get the difference of nvarchar datype fields. help....
-
thanks,but is still not working because the datatype of TimeIN and TimeOUT is Nvarchar not datetime,I did that because I wanted to insert them as DateTime.Now.ToShortDateString();so how will I manage to get the difference of nvarchar datype fields. help....