get date

S

Scott

I have an application that allows the user to pick a start date, then the
enter in a number of hours to do a job, then a stop date fills out a
textbox. Is there a way to find out the stop date?


if they pick 7/11/08 and enter in 10 hours for a job, how can I figure out
the actual date the job should end?
 
S

Scott

There is no particular time for the job to start. The user is only picking
the day which it will start and how many hours it will take to do the job.
 
L

Lloyd Sheen

Mark said:
[top-posting corrected]
There is no particular time for the job to start. The user is only
picking the day which it will start and how many hours it will take to
do the job.

Er, so how can you possibly know when the job ends if you don't know
when it starts...?
Another possible problem is how many hours will the person work each
day. A job which takes 10 hours where the person works one hour a day
will have a much different end date than one where the person works a
7.5 hour work day.

To me the three details that would be necessary are start date, end date
and hours to complete the job.

Just my two cents.
LS
 
S

Scott

Its not a job such as a sql job, or anything like that, its a repair job on
a car so time isn't a factor only the number of days.

so if the user body guy enters in a start date of 7/11/2008 and enters in
the number of hours its going to take to do each task, prep, paint, etc.
such as a total of 8 hours, then they should see an end date of 7/12/2008
and so on.



Mark Rae said:
[top-posting corrected]
There is no particular time for the job to start. The user is only
picking the day which it will start and how many hours it will take to do
the job.

Er, so how can you possibly know when the job ends if you don't know when
it starts...?
 
L

Lloyd Sheen

Scott said:
Its not a job such as a sql job, or anything like that, its a repair job on
a car so time isn't a factor only the number of days.

so if the user body guy enters in a start date of 7/11/2008 and enters in
the number of hours its going to take to do each task, prep, paint, etc.
such as a total of 8 hours, then they should see an end date of 7/12/2008
and so on.



Mark Rae said:
[top-posting corrected]
I have an application that allows the user to pick a start date, then
the enter in a number of hours to do a job, then a stop date fills out
a textbox. Is there a way to find out the stop date?
Yes.

If they pick 7/11/08 and enter in 10 hours for a job, how can I figure
out the actual date the job should end?
Depends what time the job starts. Does it start the moment the user
presses the button, or does it start at 00:00?
There is no particular time for the job to start. The user is only
picking the day which it will start and how many hours it will take to do
the job.
Er, so how can you possibly know when the job ends if you don't know when
it starts...?
Is this for a real application? Your example seems to go against what
you are saying. A job that takes lets say 10 hours, if there is prep
painting etc., the drying of the paint must occur prior to other steps
so the number of hours is not indicative of the time to do the job. And
what happens when an 'emergency' job comes in and the person/people
required to do the job are busy with other work.

Most jobs like this are charged by worktime not by the time the job will
be finished.

LS
 
B

bruce barker

so you take the number of hours, divide by max hours a day, to get number of
days. then add to start date. you may need to take into account non-working
days (sunday, holidays, etc).

-- bruce (sqlwork.com)


Scott said:
Its not a job such as a sql job, or anything like that, its a repair job on
a car so time isn't a factor only the number of days.

so if the user body guy enters in a start date of 7/11/2008 and enters in
the number of hours its going to take to do each task, prep, paint, etc.
such as a total of 8 hours, then they should see an end date of 7/12/2008
and so on.



Mark Rae said:
[top-posting corrected]
I have an application that allows the user to pick a start date, then
the enter in a number of hours to do a job, then a stop date fills out
a textbox. Is there a way to find out the stop date?

Yes.

If they pick 7/11/08 and enter in 10 hours for a job, how can I figure
out the actual date the job should end?

Depends what time the job starts. Does it start the moment the user
presses the button, or does it start at 00:00?

There is no particular time for the job to start. The user is only
picking the day which it will start and how many hours it will take to do
the job.

Er, so how can you possibly know when the job ends if you don't know when
it starts...?
 
S

Scott

Trust me guys, I have a boat load of questions to the business folks that
own the orginal application. This app is done in Excel and they wanted it
web enabled to use in more of their body shops.

Currently if the app says it takes 16 hours to complete a job, the app shows
4 days of work time on it, 4 days an hour, so for example in the current app
if the repair guy enters in a date of

7/22/2008
16 hours of total work time
the app shows 4 days
and an estimated done date is 7/25/08

unless there is a weekend involved then it calculates them and would move
over to the following week.

So if the start date was 7/24/2008 then the app would show
16 hours of work time
4 days to complete
est done date would be 7/30/2008
and then show 4 weekdays and 2 weekend days



Mark Rae said:
[top-posting corrected again]
so if the user body guy enters in a start date of 7/11/2008 and enters in
the number of hours its going to take to do each task, prep, paint, etc.
such as a total of 8 hours, then they should see an end date of 7/12/2008
and so on.

That makes no sense...

A day isn't 8 hours long. If I start work at 8am on 11th and work for 8
hours, that doesn't make it 12th...
 
A

akki

I think u have solution ready made with you.

requirement 1: No of hours which make one working day = 4hrs
requirement 2: Should not include weekends.

so you can get number of work day = total works hours/1 working day
(in hrs)

end day = start day + number of work days

that is it you are done.

For finding weekend you can use DayOfWeek enum
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top