-
July 13th, 2005, 04:33 AM
#1
Time Deviation
Hi all,
Ok, here is my situation:
I want to know if a employee worked more or less hours than th expected so I am doing this operation with TimeSpan Vars
time_deviation = time_work - time_expected;
now the problem is I need to put that value in a MS-Sql Server Db with and ODBC Connection, but I can't, I tried put like ODBCType.Time and the timespan and it says that funcionallity is not installed, then I tried to save it as dateTime, but datetime does not give you a negative value....
What do you ppl suggest me to do?
-
July 13th, 2005, 05:56 AM
#2
Re: Time Deviation
I would work with simple int instead TimeSpan. Just count difference in minutes. Differences is seconds does not make sence, difference in tens of hours have not to be expected. At least for database, I would store only difference as integer. I think this is the fastest and the most simple solution which would work.
- Make it run.
- Make it right.
- Make it fast.
Don't hesitate to rate my post.
-
July 13th, 2005, 02:14 PM
#3
Re: Time Deviation
IMHO:
Have two fields in you table,
1. a boolean indicating a positive or negative time span.
2. the actual timespan (datetime type) value. Only that u have to make it a positive value before u get it to the database.
There has been an alarming increase in the number of things I know nothing about .
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|