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.
| Author |
Topic |
|
rajani
Constraint Violating Yak Guru
367 Posts |
Posted - 2004-06-29 : 22:11:44
|
| Hi friendsI think i've a interesting problem.we have a table i.e worktime with following fieldsWTID{PK} Varchar(5)--NOT NULL,wt_starttime Datetime(8) not NULL,wt_stoptime Datetime(8)--NULLthis table records our working time on a task .The front end application has start and end buttons which will populate abv table.Now we some colleagues who work at different locations and they dont have our frontend application.so what they do is they send us total timespent on task.for exampletask1 -2hourstask2 -2days like that.my task is to create a program that will create start and end dates.for example (for task1 )when i pass 2hrs it should returnwt_starttime='28/06/2004 10.00.00'wt_stoptime='28/06/2004 12.00.00'u get the idea ,right?any ideas on this please.many thanksCheers |
|
|
ValterBorges
Master Smack Fu Yak Hacker
1429 Posts |
Posted - 2004-06-29 : 23:50:32
|
| The two hours your entering is relative to what time?Begining of the week, beginning of the day, what hour??Anyways you'll want to look at the date functions in sql server which can be found in help books online. |
 |
|
|
rajani
Constraint Violating Yak Guru
367 Posts |
Posted - 2004-06-29 : 23:52:01
|
| May b we could say on a given day anytime between 8.30 to 5.30pmCheers |
 |
|
|
rajani
Constraint Violating Yak Guru
367 Posts |
Posted - 2004-06-30 : 00:09:00
|
| It looks like i can use dateadd() here..select DATEADD(hh, 2, @somedate)Thanks ValterBorges ur suggestion helped meCheers |
 |
|
|
|
|
|