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
 SQL Server 2000 Forums
 Transact-SQL (2000)
 generate start and end times??

Author  Topic 

rajani
Constraint Violating Yak Guru

367 Posts

Posted - 2004-06-29 : 22:11:44
Hi friends
I think i've a interesting problem.we have a table i.e worktime with following fields

WTID{PK} Varchar(5)--NOT NULL,
wt_starttime Datetime(8) not NULL,
wt_stoptime Datetime(8)--NULL

this 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 example
task1 -2hours
task2 -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 return
wt_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 thanks

Cheers

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.
Go to Top of Page

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.30pm

Cheers
Go to Top of Page

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 me

Cheers
Go to Top of Page
   

- Advertisement -