473,387 Members | 1,440 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,387 software developers and data experts.

How do I update staff charge out rate without changing historical data?

I am creating a timesheet system for my company and its got a pretty simple layout at the minute.
I am multiplying the staff charge out rate to the hours they have worked on a job.
Every now and then staff gets a payrise which increases their charge out rate.
I want to keep the calculated values that staff has spent on the project already and want the charge out rate to change as from the date their rate increased.
How would I be able to do this?
May 15 '12 #1
13 1901
NeoPa
32,556 Expert Mod 16PB
You need to include it in the design Jenny. IE. You can maintain a Default charge-out rate centrally, but each charge record needs to store the actual rate used.
May 15 '12 #2
Thanks for your reply!
I don't really undersrand..
So I would need a table to store staff charge out rates, and add new charge out rates to it as they change?
May 15 '12 #3
NeoPa
32,556 Expert Mod 16PB
I can't explain much more directly as I have so little information as to what you're working with/within.

You would need to store a charge-out rate somewhere at a point which is not date or time related. This would be the (default) value to pick up when creating an item which is date or time related. If each member of staff has a record then such a record would be appropriate for holding the default value. When an item is created that uses such a charge, EG. a job is done by that member of staff at a particular time on a particular date, then an item would be created to reflect that which would have to include a charge value which would be picked up from the record for the member of staff, but would not be linked to it in any way thereafter. Thus, if the MoS's rate subsequently went up, the record for that charge would still reflect the historical rate.
May 15 '12 #4
zmbd
5,501 Expert Mod 4TB
Jennytranxx

Having helped my Grandpa on the construction site I think I know what you're after, which should be the total labor charges against the project cost - is that correct?

-z
May 15 '12 #5
Absolutely! thats exactly what I am after.
I have a:
Staff table - Staff ID, Name, COR (Charge out rate)
Project table - Project ID, Name, Description
Time on Project table - Time ID, Project ID, Staff ID, COR, Time on project
A query set up to multiply the time with the COR.


I've resorted to moving all the data from 'Time on Job' to a new table ('Time on Job Append') using an append query, then use an update query to update the charge out rate of the staff, clear the data from the 'Time on Job' table and start entering again. So everytime a new Charge out rate has changed, that is what I would do. There is probably a MUCH better method for me to do this isn't there?
May 15 '12 #6
zmbd
5,501 Expert Mod 4TB
Jennytranxxx:

A few things about the field names:
It will make your life easier not to use any non-alphanumeric charactor other than the underscore in your field and table names. so your "Staff ID" becomes "Staff_ID" or "StaffID"

"Name" is a reserved word, there are a lot of common words that SQL and VBA use either as constants, functions, etc... "Date" is another one. I suggest changing "Name" to "StaffName" or anything else ("Date" could become "StartDate" etc...) Google "vba Access reserved words" if you want to find a list.

[tbl_TimeOnProject] - how are you using this table?
-- what value are you storing in [tbl_TimeOnProject]![TimeID]
-- is the [tbl_TimeOnProject]![COR] field linked to the [tbl_staff]![COR]
-- are there more than one record per [tbl_staff]![StaffID] per [tbl_project]![ProjectID]
May 15 '12 #7
NeoPa
32,556 Expert Mod 16PB
Jenny, this is so much easier to work with now all the relevant information has been posted (See your post #6).

From that I can't help wondering why you're asking the question. You already seem to have a data structure set up to handle your problem. It's hard to imagine that's in the design yet you, the designer, don't know how to use it. Not that it's important, just confusing for me.

Your [Time on Project] table has a [COR] field which is set at the time the data is entered for each individual record. It may come originally from the [COR] field from a [Staff] record, but when [COR] changes in the [Staff] record the [COR] field in the [Time on Project] record typically wouldn't change. This gives you an accurate historical position of all the [COR] values. Does this make sense?
May 16 '12 #8
zmbd
5,501 Expert Mod 4TB
Jenny,
Is NeoPa correct in that the [Time On Project]![COR] as he has stated or is it a linked field?

-z
May 16 '12 #9
I'm really sorry for the confusion, I haven't used Access in 6 years and all has been forgotten so I may probably have got alot of this wrong.

zmbd - Sorry I was just stating briefly the field names here, I understand the 'name' and 'date' rule, I have the correct field names on my db.
[tbl_TimeOnProject]![TimeID] is an autonumber.
[tbl_TimeOnProject]has the following field-
Time ID
Project Number
Staff ID
Week end
Stage
Time
Unpaid time
There is no COR field in this table. I have confused everyone. I'm sorry.
1 staff can work on may jobs.
I used the following query to enter data:
Job number
weekend
staff ID
forename
Surname
COR
Stage
Time
Total cost :[COR]*[Time]
forename, surname COR will be populated when Staff ID is chosen.

does this make sense?
May 16 '12 #10
NeoPa
32,556 Expert Mod 16PB
Jenny:
does this make sense?
Sort of. It makes it clearer why you didn't see the solution if the design is as you describe it in post #10 certainly.

I would change the design to match the one you mistakenly posted earlier (for the reasons already made clear in post #8). This will give you what you have requested - the ability to keep both a current [COR] for each member of [Staff], as well as the ability to report correctly on historical transactions.
May 16 '12 #11
zmbd
5,501 Expert Mod 4TB
NeoPa,
You beat me to it! :)

z
May 16 '12 #12
Will do.
Thanks so much for your help! thank you
May 16 '12 #13
NeoPa
32,556 Expert Mod 16PB
@Jenny - It's a pleasure :-)
@zmbd - Jenny's post #6 accidentally answered the question for me really. I just had to say "Yes. Do that."
May 17 '12 #14

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Ron Brennan | last post by:
Good morning. I have a page displayed and want to get information from a user using showModalDialog, and then send a request to the server for more information based on the user info from the...
1
by: rottytooth | last post by:
A general data design question: We have data which changes every week. We had considered seperating historical records and current records into two different tables with the same columns, but...
1
by: Àèά Íõ | last post by:
hi, now, i don't know how to ask a historical query? which command? thanks! __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam...
16
by: StenKoll | last post by:
Help needed in order to create a register of stocks in a company. In accordance with local laws I need to give each individual share a number. I have accomplished this by establishing three tables...
3
by: Erwin | last post by:
I have a work assignment in which I have to put a historical archive within access which can be used for trendlines etc. It contains data about month, service percentages and numbers. Within a...
2
by: S P Arif Sahari Wibowo | last post by:
Hi! Do you know how to put a form's Access-Visual-Basic-code that will force the form to be inserted, while the user has not type anything in the form, without changing focus, selection, etc.? ...
5
by: John Smith | last post by:
I have tables that I want to fire either an update or insert trigger on. I could write a script containing a long list of inserts but I'm looking for something simpler. Would isql work? Any...
1
by: sbowman | last post by:
I'm in the process of creating a monthly reporting database. I've worked out all the queries which are all counts of particular field values. I need to store these values in a table for historical...
3
by: ec2046 | last post by:
I am not sure what the best approach would be to set up system through which my buddy can run simulated calculation historical data. I thought about setting up a large Excel spreadsheet or setting...
2
nicebasic
by: nicebasic | last post by:
I have written a small VB Application to play my Audio Files the way I like. But, up to now, I haven't been able to change the speed of the audio file without changing its pitch. As you know, it's...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.