Wrox Programmer Forums
|
SQL Server 2005 General discussion of SQL Server *2005* version only.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server 2005 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 17th, 2007, 03:25 PM
Friend of Wrox
 
Join Date: Jan 2007
Posts: 109
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to scandalous Send a message via MSN to scandalous
Default datetime

I am trying to make a database that tracks employee time. I was wondering if anyone knows the standard practice in doing so.

right now I have a "TimeIN" and "TimeOUT" both of which are "datetime" datatypes. what i am concerned about is whether or not to make another Column that is calculated to show total time worked for a single Transaction and then add it upto get Total hours worked for that day or if there is some other standard that is used.

TimeIN
TimeOUT
Break Paid 30 minutes only
TimeIN
TimeOUT
Lunch Paid 30 minutes only
TimeIN
TimeOUT
End Day.
Summary for that Day.
 
Old December 19th, 2007, 05:12 AM
Registered User
 
Join Date: Dec 2007
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to ssaranam
Default

i think u creaed timein, timeout columns 3 time's try like this
timein
timeout
Tea break time
Aft T break Timein
aft T break Timeout
Lunch break
aft lunch timein
aft lunch timeout


suresh
 
Old December 19th, 2007, 10:18 AM
Friend of Wrox
 
Join Date: Aug 2006
Posts: 231
Thanks: 0
Thanked 1 Time in 1 Post
Default

well i feel to calculate single transaction hours there is no need to add new column if you need it in reports do calculation there

thanks......
 
Old December 19th, 2007, 10:33 AM
Friend of Wrox
 
Join Date: Oct 2006
Posts: 475
Thanks: 0
Thanked 9 Times in 9 Posts
Default

Instead of maintaining the value of a physical column for this, create a "calculated column" to do the math for you. It will ALWAYS be up to date and the developers won't have to worry about doing the calculation right everytime in their code.

--Jeff Moden





Similar Threads
Thread Thread Starter Forum Replies Last Post
datetime MathLearner Beginning VB 6 0 November 15th, 2007 07:12 AM
DateTime pzmrcd C# 3 July 26th, 2007 06:35 AM
DateTime RickP SQL Server 2000 7 December 14th, 2005 07:08 PM
UTC DateTime to Local DateTime r_ganesh76 SQL Server 2000 1 April 4th, 2005 08:21 AM
DateTime DARSIN General .NET 1 December 1st, 2004 06:24 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.