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
 adding formula to column in table

Author  Topic 

pnasz
Posting Yak Master

101 Posts

Posted - 2010-10-13 : 01:40:57
I have a table with column TimeIN, TimeOut, HrWorked

in hrWorked column i want TimeIn-TimeOut

can you help

jafrywilson
Constraint Violating Yak Guru

379 Posts

Posted - 2010-10-13 : 01:52:54
Not clear ..Give some more examples..
Go to Top of Page

pnasz
Posting Yak Master

101 Posts

Posted - 2010-10-13 : 02:01:57
I want a calculated field which can calculate Hrworked automatically using formula as i insert timein and timeout
Go to Top of Page

pnasz
Posting Yak Master

101 Posts

Posted - 2010-10-13 : 02:04:33
TimeIn TimeOut HrWorked

11:30:10 12:45:10 (Should be calculated automatically using formula)
Go to Top of Page

jafrywilson
Constraint Violating Yak Guru

379 Posts

Posted - 2010-10-13 : 02:26:43
select datediff(s,TimeIn , TimeOut )

Try this..
Go to Top of Page
   

- Advertisement -