473,385 Members | 1,983 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Time and Attendance Recording

Hi There,

My company run a flexi time system whereby you can work extra hours to gain
additionnal days off.

In order to better plan my time I would like to design a database which
works out the flexitime based on the values you enter and assuming a 7.4
hour working day (based on a 37 hour week).

The data I would have is the daily start and finish times and a flexi
balance as a starting point.

I would also like the ability to add further flexi balance records to check
the figures in the future.

I have given an example below (numbers calculated mentally so forgive any
errors)
TABLE - TIMES (Copied from system or enterred speculatively to help plan
holidays)
---------------------

DateVal StartTime EndTime

01/01/01 07.45 18.00
02/01/01 09.00 17.42
03/01/01... 08.45 17.45
etc
TABLE - FLEXI (Copied from System as a starting point and as references)
--------------------

DateVal FlexiBalance
01/01/01 -2.00
03/01/05 02.09
etc
QUERY - FLEXIBALANCE (works out the flexi balance on a daily basis)
------------------------------------

DateVal StartTime EndTime StartFlex EndFlex FlexChk

01/01/01 07.45 18.00 -02.00 00.51 -02.00
02/01/01 09.00 17.42 00.51 02.09
03/01/01 08.45 17.45 02.09 03.45 02.09
Nov 13 '05 #1
5 2082
Sorry, sent that too quickly...

I meant to put a "thanks in advance" and my name at the bottom (which is
John by the way).

"John Ortt" <Jo******@Idontwantspamsonoreturnaddress.com> wrote in message
news:42**********@glkas0286.greenlnk.net...
Hi There,

My company run a flexi time system whereby you can work extra hours to gain additionnal days off.

In order to better plan my time I would like to design a database which
works out the flexitime based on the values you enter and assuming a 7.4
hour working day (based on a 37 hour week).

The data I would have is the daily start and finish times and a flexi
balance as a starting point.

I would also like the ability to add further flexi balance records to check the figures in the future.

I have given an example below (numbers calculated mentally so forgive any
errors)
TABLE - TIMES (Copied from system or enterred speculatively to help plan
holidays)
---------------------

DateVal StartTime EndTime

01/01/01 07.45 18.00
02/01/01 09.00 17.42
03/01/01... 08.45 17.45
etc
TABLE - FLEXI (Copied from System as a starting point and as references)
--------------------

DateVal FlexiBalance
01/01/01 -2.00
03/01/05 02.09
etc
QUERY - FLEXIBALANCE (works out the flexi balance on a daily basis)
------------------------------------

DateVal StartTime EndTime StartFlex EndFlex FlexChk

01/01/01 07.45 18.00 -02.00 00.51 -02.00 02/01/01 09.00 17.42 00.51 02.09
03/01/01 08.45 17.45 02.09 03.45 02.09

Nov 13 '05 #2
Hi John.

You can calculate the number of minutes worked like this:
Minutes: DateDiff("n", [StartTime], [EndTime])

You are assuming 7.4 hours per day, so the extra minutes is:
ExtraMinutes: 444 - DateDiff("n", [StartTime], [EndTime])

Assuming you have exactly 5 records per worker per week (even if they don't
show up, or show up on 6 days), you could then sum the ExtraMinutes to get a
progressive total. Those assumptions are probably unsafe, so you will need
to calculate on the number of weeks in the timeframe you are considering
(week/month/...) times 2220.

For suggestions on displaying the results in hour:min format, see:
Calculating elapsed time
at:
http://allenbrowne.com/casu-13.html

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
"John Ortt" <Jo******@Idontwantspamsonoreturnaddress.com> wrote in message
news:42**********@glkas0286.greenlnk.net...
Hi There,

My company run a flexi time system whereby you can work extra hours to
gain
additionnal days off.

In order to better plan my time I would like to design a database which
works out the flexitime based on the values you enter and assuming a 7.4
hour working day (based on a 37 hour week).

The data I would have is the daily start and finish times and a flexi
balance as a starting point.

I would also like the ability to add further flexi balance records to
check
the figures in the future.

I have given an example below (numbers calculated mentally so forgive any
errors)
TABLE - TIMES (Copied from system or enterred speculatively to help plan
holidays)
---------------------

DateVal StartTime EndTime

01/01/01 07.45 18.00
02/01/01 09.00 17.42
03/01/01... 08.45 17.45
etc
TABLE - FLEXI (Copied from System as a starting point and as references)
--------------------

DateVal FlexiBalance
01/01/01 -2.00
03/01/05 02.09
etc
QUERY - FLEXIBALANCE (works out the flexi balance on a daily basis)
------------------------------------

DateVal StartTime EndTime StartFlex EndFlex FlexChk

01/01/01 07.45 18.00 -02.00
00.51 -02.00
02/01/01 09.00 17.42 00.51 02.09
03/01/01 08.45 17.45 02.09 03.45
02.09

Nov 13 '05 #3
Probably not a good idea to have accurate records for 'flexi' time.
Most employees are *required* to be paid for hours worked over 40 per
week.

http://www.dol.gov/elaws/esa/flsa/ho...ed/default.asp

A disgruntled employee could call the Dept. of Labor and mess it up for
everyone.

Nov 13 '05 #4
I have set-up a Time and attendance database as outlined in the "Time and
Attendance Recording" thread.

I have now figured out how to get it to work (and successfully done so on a
stripped down test) but when I try to run the proper version I get a Dr
Watson error.

Can anyone see any obvious problems on the following query

(qryMaster) SELECT qryFlexi.DateID, (Select max (Flexi) FROM [tblFlexi] as
[tblFlexi2] WHERE ([tblFlexi2].[DateID] <= [qryFlexi].[DateID]) ;) AS
LastFlex, (Select sum (FlexChangeDeci) FROM [qryFlexi] as [qryFlexi2] WHERE
([qryFlexi2].[DateID] <= [qryFlexi].[DateID]) and ([qryFlexi2].[DateID] >=
[qryFlexi].[PrevFlex]);) AS CFCDeci,
IIf(Left([LastFlex],1)="-",Left([LastFlex],4)-Right([LastFlex],2)/60,Left([L
astFlex],3)+Right([LastFlex],2)/60) AS PrevFlexDeci,
[CFCDeci]+[PrevFlexDeci] AS FlexiDeci
FROM qryFlexi LEFT JOIN tblFlexi ON qryFlexi.DateID = tblFlexi.DateID;

Any help would be greatly appreciated,

Thanks,

John

the Sql for the other queries (incase required) is as follows:

(qryDayOfWeek) SELECT tblTimes.DateID, Weekday([DateID]) AS DayOfWeek,
IIf(Weekday([DateID])=1 Or
Weekday([DateID])=7,"3",IIf(Weekday([DateID])=6,"2","1")) AS DayCode,
tblTimes.ClockOn, tblTimes.ClockOff, tblTimes.Absence, tblTimes.Reason
FROM tblTimes;

(qryTimes) SELECT qryDayOfWeek.DateID, Hour([ClockOn])+Minute([ClockOn])/60
AS ST, Hour([ClockOff])+Minute([ClockOff])/60 AS FT, IIf([Absence] Is Not
Null,0,IIf([DayCode]="1" Or ([DayCode]="2" And [FT]>=13),0.7,0)) AS LT,
IIf(([Absence]="AM" Or
[Absence]="FULLDAY"),0,IIf([DayCode]="3",IIf([ST]<=12,IIf([FT]<12,[FT]-[ST],
12-[ST]),0),IIf([ST]<=7,7.5-[ST],0))) AS AMOT, IIf(([Absence]="PM" Or
[Absence]="FULLDAY"),0,IIf([DayCode]="3",IIf([FT]>=12,IIf([ST]>12,[FT]-[ST],
[FT]-12),0),IIf([FT]>=18.5,[FT]-18,0))) AS PMOT, IIf(([Absence]="AM" Or
[Absence]="FULLDAY") And [reason]="Flexi",-3.7,IIf(([Absence]="AM" Or
[Absence]="FULLDAY"),0,IIf([DayCode]="3",0,IIf([ST]<7.5,IIf([FT]>12,12-7.5,[
FT]-7.5),IIf([FT]>12,12-[ST],[FT]-[ST]))))) AS AMCT, IIf(([Absence]="AM" Or
[Absence]="FULLDAY") And [reason]="Flexi",-3.7,IIf(([Absence]="AM" Or
[Absence]="FULLDAY"),0,IIf([DayCode]="3",0,IIf([FT]>18,IIf([ST]>12,18-[ST],1
8-12),IIf([ST]>12,[FT]-[ST],[FT]-12))))) AS PMCT, [PMCT]+[AMCT]-[LT] AS CT,
[AMOT]+[PMOT] AS OT, IIf([reason] Is Null Or [reason]="",[CT],IIf([reason]
Is Not Null And
[reason]<>"Flexi",IIf([absence]="FULLDAY",7.4,IIf([absence]="AM",[PMCT]+3.7,
[AMCT]+3.7)),IIf([reason]="Flexi",IIf([absence]="FULLDAY",0,IIf([absence]="A
M",[PMCT],[AMCT]))))) AS FA, [FA]-7.4 AS FC, qryDayOfWeek.Absence,
qryDayOfWeek.Reason
FROM qryDayOfWeek
ORDER BY qryDayOfWeek.DateID;

(qryFlexi) SELECT qryTimes.DateID, qryTimes.FC AS FlexChangeDeci, (Select
max (dateID) FROM [tblflexi] as Temp WHERE [temp].[dateid] <=
[qrytimes].[dateid]) AS PrevFlex
FROM qryTimes;



Nov 13 '05 #5
I have narrowed it down to the following line...but I still can't see what's
wrong :(

(Select sum (FlexChangeDeci) FROM [qryFlexi] as [qryFlexi2] WHERE
([qryFlexi2].[DateID] <= [qryFlexi].[DateID]) and ([qryFlexi2].[DateID] >=
[qryFlexi].[PrevFlex]);) AS CFCDeci
Nov 13 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: timgeitz | last post by:
I would like to design a drop down option box on a form which gives me several choices for putting in an attendance date to record church attendance. Typically, a church secretary would record a...
0
by: Bill | last post by:
I've searched comp.databases.ms-access for a solution and found help but still haven't got my problem solved. I want to record weekly attendance and print an attendance "check off" sheet where...
3
by: lucky33 | last post by:
My employer has asked me to create a database that will keep track of the employee attendance. Time off / Time earned, excused / unexcused, etc. At my company from the 6th month of employment to...
3
by: Cron | last post by:
Hi I'm trying to Dcount *unique* records by comparing a date/time field. I say *unique* because the field contains a date/time but I need to ignore the timestamp and work off the date only. I...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.