Sign Up |  Live StatsLive Stats    Articles 35,345| Comments 159,790| Members 17,820, Newest waheguruhelpme| Online 202
Home Contact
 (Forgotten?): 
    Sikhism

   
                                                                     Your Banner Here!    

Count Working hour between time

Our Donation Goal : Why Donate? : Donate Today! : Donate Anonymously (ਗੁਪਤ) : Our Family of Supporters
Goal this month: 400 USD, Received: 35 USD (9%)
Please Donate...
Related Topics...
Thread Thread Starter Forum Replies Last Post
7 Children Go Missing Every Hour Soul_jyot India 0 21-Feb-2011 05:33 AM
The Singhs on The Hour - The Face of Sikh Youth Aman Singh Sikh Youth 4 05-Apr-2009 08:41 AM
Calculate elapsed time excluding time for breaks, lunch, etc SJR@mbci Information Technology 2 28-Jul-2006 08:03 AM
Six-hour gun battle near LoC, eight killed (People's Daily) Neutral Singh Sikh News 0 08-Jul-2005 16:39 PM


Tags
count, working, hour, between, time
Reply Post New Topic In This Forum Stay Connected to Sikhism, Click Here to Register Now!
  #1 (permalink)  
Old 28-Jul-2006, 08:29 AM
haviv's Avatar haviv
Guest
 
Posts: n/a
   
   
Count Working hour between time

  Donate Today!   Email to Friend  Tell a Friend   Show Printable Version  Print   Contact sikhphilosophy.net Administraion for any Suggestions, Ideas, Feedback.  Feedback  

Register to Remove Advertisements
Hai,

I am in the middle creating report in access to count working turn time. I
have a series raw data consist of three coloum

1. User
2. Time and Date of Start working project
3. Time and Date of finished working project
4. Working hour from 08.00 - 17.00

The issue here the user can start at anytime he like and finish at any time
he like. But i need to count how many hours have he use to finish the
project. I can create a logic to count. Issue here i have to be able create a
logic or function than can cater below possible event


Event one
If project starts at 07.45 and finish at 08.45 then the turn time will be 45
minute
(08.45 minus 08.00)

Event two
If the projects starts at 08.45 and finish at 09.45 the turn time will be 1
hour
(09.45 minus 08.45)

Event three
If the project starts at 16:00 and finish at 18:00 the turn time will be 2
hour
(18.00 minus 16.00)

Event four
If the project starts at 16:00 today and finish at 09:00 the next day the
turn time will be 2 hour as
(17.00 minus 16.00 plus 09.00 minus 08.00)

Event five
If the project starts at 16:00 today and finish at 09:00 the next 2 day the
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/information-technology/12482-count-working-hour-between-time.html
turn time will be 10 hour
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=12482
(17.00 minus 16.00 plus 17.00 minus 08.00 plus 09.00 minus 08.00)

You see i need a logic can cater all event the tricky part is in the even
three and four which hard to be diffrentiate

Please advise if any of you have a sample of project of a sample of logic
that can cater all above event

Sincerely Yours
Haviv





 
Do share your immediate thoughts or reactions on this issue? We value your views! Login Now! or Sign Up Today! to share your views with us.. Gurfateh!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 28-Jul-2006, 08:29 AM
James A. Fortune's Avatar James A. Fortune
Guest
 
Posts: n/a
   
   
Re: Count Working hour between time

haviv wrote:
> Hai,
>
> I am in the middle creating report in access to count working turn time. I
> have a series raw data consist of three coloum
>
> 1. User
> 2. Time and Date of Start working project
> 3. Time and Date of finished working project
> 4. Working hour from 08.00 - 17.00
>
> The issue here the user can start at anytime he like and finish at any time
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=12482
> he like. But i need to count how many hours have he use to finish the
> project. I can create a logic to count. Issue here i have to be able create a
> logic or function than can cater below possible event
>
>
> Event one
> If project starts at 07.45 and finish at 08.45 then the turn time will be 45
> minute
> (08.45 minus 08.00)
>
> Event two
> If the projects starts at 08.45 and finish at 09.45 the turn time will be 1
> hour
> (09.45 minus 08.45)
>
> Event three
> If the project starts at 16:00 and finish at 18:00 the turn time will be 2
> hour
> (18.00 minus 16.00)
>
> Event four
> If the project starts at 16:00 today and finish at 09:00 the next day the
> turn time will be 2 hour as
> (17.00 minus 16.00 plus 09.00 minus 08.00)
>
> Event five
> If the project starts at 16:00 today and finish at 09:00 the next 2 day the
> turn time will be 10 hour
> (17.00 minus 16.00 plus 17.00 minus 08.00 plus 09.00 minus 08.00)
>
> You see i need a logic can cater all event the tricky part is in the even
> three and four which hard to be diffrentiate
>
> Please advise if any of you have a sample of project of a sample of logic
> that can cater all above event
>
> Sincerely Yours
> Haviv


Try the information in the following thread:
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=12482

http://groups.google.com/group/comp....ed54b162a1aa3c

James A. Fortune
MPAPoster@FortuneJames.com
Reply With Quote
  #3 (permalink)  
Old 28-Jul-2006, 08:29 AM
Ron2006's Avatar Ron2006
Guest
 
Posts: n/a
   
   
Re: Count Working hour between time

If you starting time can NEVER be after 17:00 nor before 8:00
AND ending has the same constraint
AND the field 2 can never be greater than field 3.

Then if the start date = end date (just the date part) then the
subtract field 2 from field 3

ELSE

workdays = DateDiff("d",[StartDate],[EndDate]) - 1 (you want to use
ONLY the date part of the fields)
hours = workdays * 9
hours2 = #17:00# - datepart ("h",field2)
Hours2 = hours2 + (datepart ("h",field3) - #8:00#
Hours = hours + hours2

The above is basically true IF you work on weekends and holidays.

=============================
If you do not work on weekends then

WorkDays=DateDiff("d",[StartDate],[EndDate])-(DateDiff("ww",[StartDate],[EndDate
],7)+DateDiff("ww",[StartDate],[EndDate],1))


First datediff is total number of days between dates.
Second datediff is number of Saturdays between dates
Third datediff is number of Sundays between dates.
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=12482

I believe you will also have to subtract 1 from workdays here to get
the proper count of full days used.

============================
If you do not work on Holidays
then you will need a table of holidays (the workday that would be taken
off inplace of the holiday - Monday if holiday is on Sunday)

Then use dCount on that table counting the number of dates in the table
between date part of field2 and field3 and subtract that from the
above computed workdays.

===========================

Ron


James A. Fortune wrote:
> haviv wrote:
> > Hai,
> >
> > I am in the middle creating report in access to count working turn time. I
> > have a series raw data consist of three coloum
> >
> > 1. User
> > 2. Time and Date of Start working project
> > 3. Time and Date of finished working project
> > 4. Working hour from 08.00 - 17.00
> >
> > The issue here the user can start at anytime he like and finish at any time
> > he like. But i need to count how many hours have he use to finish the
> > project. I can create a logic to count. Issue here i have to be able create a
> > logic or function than can cater below possible event
> >
> >
> > Event one
> > If project starts at 07.45 and finish at 08.45 then the turn time will be 45
> > minute
> > (08.45 minus 08.00)
> >
> > Event two
> > If the projects starts at 08.45 and finish at 09.45 the turn time will be 1
> > hour
> > (09.45 minus 08.45)
> >
> > Event three
> > If the project starts at 16:00 and finish at 18:00 the turn time will be 2
> > hour
> > (18.00 minus 16.00)
> >
> > Event four
> > If the project starts at 16:00 today and finish at 09:00 the next day the
> > turn time will be 2 hour as
> > (17.00 minus 16.00 plus 09.00 minus 08.00)
> >
> > Event five
> > If the project starts at 16:00 today and finish at 09:00 the next 2 day the
> > turn time will be 10 hour
> > (17.00 minus 16.00 plus 17.00 minus 08.00 plus 09.00 minus 08.00)
> >
> > You see i need a logic can cater all event the tricky part is in the even
> > three and four which hard to be diffrentiate
> >
> > Please advise if any of you have a sample of project of a sample of logic
> > that can cater all above event
> >
> > Sincerely Yours
> > Haviv

>
> Try the information in the following thread:
>
> http://groups.google.com/group/comp....ed54b162a1aa3c
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=12482
>
> James A. Fortune
> MPAPoster@FortuneJames.com


Reply With Quote
  #4 (permalink)  
Old 28-Jul-2006, 08:29 AM
James A. Fortune's Avatar James A. Fortune
Guest
 
Posts: n/a
   
   
Re: Count Working hour between time

Ron2006 wrote:
> If you starting time can NEVER be after 17:00 nor before 8:00
> AND ending has the same constraint
> AND the field 2 can never be greater than field 3.
>
> Then if the start date = end date (just the date part) then the
> subtract field 2 from field 3
>
> ELSE
>
> workdays = DateDiff("d",[StartDate],[EndDate]) - 1 (you want to use
> ONLY the date part of the fields)
> hours = workdays * 9
> hours2 = #17:00# - datepart ("h",field2)
> Hours2 = hours2 + (datepart ("h",field3) - #8:00#
> Hours = hours + hours2
>
> The above is basically true IF you work on weekends and holidays.
>
> =============================
> If you do not work on weekends then
>
> WorkDays=DateDiff("d",[StartDate],[EndDate])-(DateDiff("ww",[StartDate],[EndDate
> ],7)+DateDiff("ww",[StartDate],[EndDate],1))
>
>
> First datediff is total number of days between dates.
> Second datediff is number of Saturdays between dates
> Third datediff is number of Sundays between dates.
>
> I believe you will also have to subtract 1 from workdays here to get
> the proper count of full days used.
>
> ============================
> If you do not work on Holidays
> then you will need a table of holidays (the workday that would be taken
> off inplace of the holiday - Monday if holiday is on Sunday)
>
> Then use dCount on that table counting the number of dates in the table
> between date part of field2 and field3 and subtract that from the
> above computed workdays.
>
> ===========================
>
> Ron
>
>
> James A. Fortune wrote:
>
>>haviv wrote:
>>
>>>Hai,
>>>
>>>I am in the middle creating report in access to count working turn time. I
>>>have a series raw data consist of three coloum
>>>
>>>1. User
>>>2. Time and Date of Start working project
>>>3. Time and Date of finished working project
>>>4. Working hour from 08.00 - 17.00
>>>
>>>The issue here the user can start at anytime he like and finish at any time
>>>he like. But i need to count how many hours have he use to finish the
>>>project. I can create a logic to count. Issue here i have to be able create a
>>>logic or function than can cater below possible event
>>>
>>>
>>>Event one
>>>If project starts at 07.45 and finish at 08.45 then the turn time will be 45
>>>minute
>>>(08.45 minus 08.00)
>>>
>>>Event two
>>>If the projects starts at 08.45 and finish at 09.45 the turn time will be 1
>>>hour
>>>(09.45 minus 08.45)
>>>
>>>Event three
>>>If the project starts at 16:00 and finish at 18:00 the turn time will be 2
>>>hour
>>>(18.00 minus 16.00)
>>>
>>>Event four
>>>If the project starts at 16:00 today and finish at 09:00 the next day the
>>>turn time will be 2 hour as
>>>(17.00 minus 16.00 plus 09.00 minus 08.00)
>>>
>>>Event five
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=12482
>>>If the project starts at 16:00 today and finish at 09:00 the next 2 day the
>>>turn time will be 10 hour
>>>(17.00 minus 16.00 plus 17.00 minus 08.00 plus 09.00 minus 08.00)
>>>
>>>You see i need a logic can cater all event the tricky part is in the even
>>>three and four which hard to be diffrentiate
>>>
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=12482
>>>Please advise if any of you have a sample of project of a sample of logic
>>>that can cater all above event
>>>
>>>Sincerely Yours
>>>Haviv

>>
>>Try the information in the following thread:
>>
>>http://groups.google.com/group/comp....ed54b162a1aa3c
>>
>>James A. Fortune
>>MPAPoster@FortuneJames.com

>
>


I see that I read the post too quickly. Let me know if Ron's advice is
not enough.

James A. Fortune
MPAPoster@FortuneJames.com
Reply With Quote
  #5 (permalink)  
Old 28-Jul-2006, 08:29 AM
's Avatar
Guest
 
Posts: n/a
   
   
Re: Count Working hour between time

  Donate Today!  
Here is a function that does what you want:

'************************************************* **********
Function computeHoursWorked(dtStart As Date, dtStop As Date) As Double
'************************************************* **********
Const tStart = #8:00:00 AM#
Const tStop = #5:00:00 PM#
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=12482

' reset times to valid start or stop time, use minutes to allow for
partial hours
' must be between 0800 and 1700 inclusive (uses minutes to allow for
part hours)
If TimeValue(dtStart) < tStart Then dtStart = DateAdd("n", Hour(tStart)
* 60 + Minute(tStart), DateValue(dtStart))
If TimeValue(dtStart) > tStop Then dtStart = DateAdd("n", Hour(tStop) *
60 + Minute(tStop), DateValue(dtStart))
If TimeValue(dtStop) < tStart Then dtStop = DateAdd("n", Hour(tStart) *
60 + Minute(tStart), DateValue(dtStop))
If TimeValue(dtStop) > tStop Then dtStop = DateAdd("n", Hour(tStop) *
60 + Minute(tStop), DateValue(dtStop))

'compute difference and subtract extra invalid hours (eg. hours between
1700 and 0800)
' = overall hours difference between start and stop - invalid hours for
each complete day spanned (uses minutes to allow for part hours)
computeHoursWorked = DateDiff("n", dtStart, dtStop) / 60 - ((24 -
(DateDiff("n", tStart, tStop) / 60)) * DateDiff("d", dtStart, dtStop))

End Function

It can be stored in a module and referenced as part of a query:

e.g: SELECT User, dtStart, dtStop, ComputeHoursWorked([dStart],[dStop]) AS
HrsWorked FROM tbl_TimeCards;

You couild also reference it directly in a report:

e.g. = ComputeHoursWorked([dStart],[dStop]) ....... (where dStart
and dStop are valid fields in the report)

You would have to modify it to take into consideration Weekends or give
results in minutes instead of hours.


Brian

"haviv" wrote in message
news:A42D4520-6C08-4F3A-95F6-2D32D21A75DB@microsoft.com...
> Hai,
>
> I am in the middle creating report in access to count working turn time. I
> have a series raw data consist of three coloum
>
> 1. User
> 2. Time and Date of Start working project
> 3. Time and Date of finished working project
> 4. Working hour from 08.00 - 17.00
>
> The issue here the user can start at anytime he like and finish at any
> time
> he like. But i need to count how many hours have he use to finish the
> project. I can create a logic to count. Issue here i have to be able
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=12482
> create a
> logic or function than can cater below possible event
>
>
> Event one
> If project starts at 07.45 and finish at 08.45 then the turn time will be
> 45
> minute
> (08.45 minus 08.00)
>
> Event two
> If the projects starts at 08.45 and finish at 09.45 the turn time will be
> 1
> hour
> (09.45 minus 08.45)
>
> Event three
> If the project starts at 16:00 and finish at 18:00 the turn time will be 2
> hour
> (18.00 minus 16.00)
>
> Event four
> If the project starts at 16:00 today and finish at 09:00 the next day the
> turn time will be 2 hour as
> (17.00 minus 16.00 plus 09.00 minus 08.00)
>
> Event five
> If the project starts at 16:00 today and finish at 09:00 the next 2 day
> the
> turn time will be 10 hour
> (17.00 minus 16.00 plus 17.00 minus 08.00 plus 09.00 minus 08.00)
>
> You see i need a logic can cater all event the tricky part is in the even
> three and four which hard to be diffrentiate
>
> Please advise if any of you have a sample of project of a sample of logic
> that can cater all above event
>
> Sincerely Yours
> Haviv



Reply With Quote
   Click Here to Donate Now!

Support Us!
Become a Promoter!
Gurfateh ji, you can become a SPN Promoter by Donating as little as $10 each month. With limited resources & high operational costs, your donations make it possible for us to deliver a quality website and spread the teachings of the Sri Guru Granth Sahib Ji, to serve & uplift humanity. Every contribution counts. Donate Generously. Gurfateh!
ReplyPost New Topic In This Forum Stay Connected to Sikhism, Click Here to Register Now!

Bookmarks


(View-All Members who have read this thread : 0
There are no names to display.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Tools Search
Search:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On

» Gurbani Jukebox
Listen to Gurbani while surfing SPN!
» Active Discussions
sikhism Who is "Mohan"?
Today 08:46 AM
22 Replies, 335 Views
sikhism How important is Matha...
Today 08:12 AM
59 Replies, 1,038 Views
sikhism need urgent advice.......
Today 06:46 AM
6 Replies, 81 Views
sikhism ਨਾਮਾ
Today 06:37 AM
2 Replies, 53 Views
sikhism Sikh Diamonds Video...
Today 04:23 AM
6 Replies, 116 Views
sikhism Are Creator and Creation...
Today 01:30 AM
44 Replies, 2,837 Views
sikhism Herman Hesse,...
Today 00:54 AM
13 Replies, 229 Views
sikhism On a Scale of Most...
Yesterday 21:42 PM
30 Replies, 1,277 Views
sikhism I became victim by...
Yesterday 19:50 PM
0 Replies, 44 Views
sikhism Sikh Books downloads
Yesterday 15:39 PM
2 Replies, 66 Views
sikhism Salok Sheikh Farid ji...
Yesterday 09:35 AM
0 Replies, 47 Views
sikhism In Punjab, three farmers...
Yesterday 05:36 AM
0 Replies, 49 Views
sikhism Supernatural Sikhs, what...
Yesterday 03:45 AM
19 Replies, 414 Views
sikhism Sukhmani Sahib Astpadi...
26-May-2012 22:57 PM
0 Replies, 51 Views
Do You Think You Are...
26-May-2012 09:59 AM
94 Replies, 8,258 Views
» Books You Should Read...
Powered by vBadvanced CMPS v3.2.2

All times are GMT +6.5. The time now is 09:02 AM.
Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.5.2 Copyright © 2004-12, All Rights Reserved. Sikh Philosophy Network


Page generated in 0.87161 seconds with 30 queries