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

Using lookups or rates problems

I have an Access database that tracks project information. The
database is very simple, except for 1 small aspect.

Some background: 4 Tables - Project information, Employees, activity
and pay rates.

The user will add an activity to a project. The activity will take
place on a date, so they will enter the date it took place and the
hours worked. The problem is that the employee might get an increase
during the project, which will need to be changed in the rates table.
This creates a new entry, keeping the old rate up to that date and I
then enter the new rate from that date.

If an activity is entered, I would like the database to automatically
look at the date the activity took place, and use the rate from the
rates table for that period.

I don't know if I have the correct apprach down for this database, and
any help would be appreciated. My boss is counting on me to make this
work, how, I don't know!

Sample table info and relationships:
Employees -- ID and name fields
Project -- ID and name, and details of project
Activity -- ID, Type of Activity, Date, employee ID and Project ID
Rates -- rateid, employee ID, rate, rate date from

Any ideas on how to make this work??

Please help!!!

--Ed
Nov 13 '05 #1
5 1682
You'll make life a lot easier if you have a from and a to date for the
rates... until a rate expires, use a far future date. It will be simpler to
use a BETWEEN criteria for a date than any other way. The tables seem to
assume that a minimum time for an activity is a full day... or you need to
add either To/From Time or HoursWorked to the Activity. I assume you want to
use the Text for the Activity... otherwise you may want to add an Activity
table with ActivityID and Description, etc. (if nothing else, that would
give you a check on data entry).

Larry Linson
Microsoft Access MVP

"Eddie" <ed**********@mousetraining.com> wrote in message
news:d5*************************@posting.google.co m...
I have an Access database that tracks project information. The
database is very simple, except for 1 small aspect.

Some background: 4 Tables - Project information, Employees, activity
and pay rates.

The user will add an activity to a project. The activity will take
place on a date, so they will enter the date it took place and the
hours worked. The problem is that the employee might get an increase
during the project, which will need to be changed in the rates table.
This creates a new entry, keeping the old rate up to that date and I
then enter the new rate from that date.

If an activity is entered, I would like the database to automatically
look at the date the activity took place, and use the rate from the
rates table for that period.

I don't know if I have the correct apprach down for this database, and
any help would be appreciated. My boss is counting on me to make this
work, how, I don't know!

Sample table info and relationships:
Employees -- ID and name fields
Project -- ID and name, and details of project
Activity -- ID, Type of Activity, Date, employee ID and Project ID
Rates -- rateid, employee ID, rate, rate date from

Any ideas on how to make this work??

Please help!!!

--Ed

Nov 13 '05 #2
Hi Larry, thanks for this. I know that I didn't tell you all the
fields in the tables. The activity table will have a hours worked on
it, very simple as we only use 1 or .5 hours. The problem is looking
up the activity date against the employee pay rate date started, and
returning the rate by the nearest match down . Its almost like the
following in a vlookup

vlookup (activity date,employee rate start date, rate).

I add activities by employee for each project. The database miust
return all the activities for the project, and the activity cost for
all or 1 employee.

Any examples would be great. I hope my blurb is clear enough.

Regards and thanks a million to anyone who helps,
Eddie Holder
Novice database builder....
ed**********@mousetraining.com (Eddie) wrote in message news:<d5*************************@posting.google.c om>...
I have an Access database that tracks project information. The
database is very simple, except for 1 small aspect.

Some background: 4 Tables - Project information, Employees, activity
and pay rates.

The user will add an activity to a project. The activity will take
place on a date, so they will enter the date it took place and the
hours worked. The problem is that the employee might get an increase
during the project, which will need to be changed in the rates table.
This creates a new entry, keeping the old rate up to that date and I
then enter the new rate from that date.

If an activity is entered, I would like the database to automatically
look at the date the activity took place, and use the rate from the
rates table for that period.

I don't know if I have the correct apprach down for this database, and
any help would be appreciated. My boss is counting on me to make this
work, how, I don't know!

Sample table info and relationships:
Employees -- ID and name fields
Project -- ID and name, and details of project
Activity -- ID, Type of Activity, Date, employee ID and Project ID
Rates -- rateid, employee ID, rate, rate date from

Any ideas on how to make this work??

Please help!!!

--Ed

Nov 13 '05 #3
Under what circumstances do you want to perform this action -- it might be
done by joining the tables in a query, using a DLOOKUP in code, or ???.
Whichever way, my advice on having an end date as well as a start date for
the rate table still stands.

SELECT x FROM y WHERE z BETWEEN a AND b

is a lot easier than trying to order the records and pick only the first one
where current date exceeds the date in the record. Records in tables in
relational databases, unlike "vlookup", are, by definition, unordered. You
have to use an ORDER BY clause in the SQL to order them (this can be
generated by "Sort" in the Query Builder).

Assuming you only need to show the rate in a report (invoice), then joining
the tables in the Query that is the RecordSource of the Report would be the
proper approach.

Larry Linson
Microsoft Access MVP

"Eddie" <ed**********@mousetraining.com> wrote in message
news:d5**************************@posting.google.c om...
Hi Larry, thanks for this. I know that I didn't tell you all the
fields in the tables. The activity table will have a hours worked on
it, very simple as we only use 1 or .5 hours. The problem is looking
up the activity date against the employee pay rate date started, and
returning the rate by the nearest match down . Its almost like the
following in a vlookup

vlookup (activity date,employee rate start date, rate).

I add activities by employee for each project. The database miust
return all the activities for the project, and the activity cost for
all or 1 employee.

Any examples would be great. I hope my blurb is clear enough.

Regards and thanks a million to anyone who helps,
Eddie Holder
Novice database builder....
ed**********@mousetraining.com (Eddie) wrote in message

news:<d5*************************@posting.google.c om>...
I have an Access database that tracks project information. The
database is very simple, except for 1 small aspect.

Some background: 4 Tables - Project information, Employees, activity
and pay rates.

The user will add an activity to a project. The activity will take
place on a date, so they will enter the date it took place and the
hours worked. The problem is that the employee might get an increase
during the project, which will need to be changed in the rates table.
This creates a new entry, keeping the old rate up to that date and I
then enter the new rate from that date.

If an activity is entered, I would like the database to automatically
look at the date the activity took place, and use the rate from the
rates table for that period.

I don't know if I have the correct apprach down for this database, and
any help would be appreciated. My boss is counting on me to make this
work, how, I don't know!

Sample table info and relationships:
Employees -- ID and name fields
Project -- ID and name, and details of project
Activity -- ID, Type of Activity, Date, employee ID and Project ID
Rates -- rateid, employee ID, rate, rate date from

Any ideas on how to make this work??

Please help!!!

--Ed

Nov 13 '05 #4
Hi Larry. I actually have found a solution to my problem. I used a sub
query to get the results. here is the syntax i used, with the help of
another user in the group.

SELECT employees.Name, rates.rate, Activity.Activitydate,
Activity.ProjectName, Activity.Hours, [Hours]*[rate] AS [Total
Activity Cost]
FROM (employees RIGHT JOIN Activity ON employees.empid =
Activity.Empid) LEFT JOIN rates ON employees.empid = rates.empid
WHERE (((rates.effectivedate)=(SELECT MAX(EffectiveDate)
FROM Rates WHERE EmpID = Employees.EmpID
AND EffectiveDate <= activity.activitydate)));
Thanks for your advice. You and the aother user was of great help.

Thanks a million

ed
Nov 13 '05 #5
You are welcome. I'm glad you found a solution.

Larry Linson
Microsoft Access MVP

"Eddie" <ed**********@mousetraining.com> wrote in message
news:d5**************************@posting.google.c om...
Hi Larry. I actually have found a solution to my problem. I used a sub
query to get the results. here is the syntax i used, with the help of
another user in the group.

SELECT employees.Name, rates.rate, Activity.Activitydate,
Activity.ProjectName, Activity.Hours, [Hours]*[rate] AS [Total
Activity Cost]
FROM (employees RIGHT JOIN Activity ON employees.empid =
Activity.Empid) LEFT JOIN rates ON employees.empid = rates.empid
WHERE (((rates.effectivedate)=(SELECT MAX(EffectiveDate)
FROM Rates WHERE EmpID = Employees.EmpID
AND EffectiveDate <= activity.activitydate)));
Thanks for your advice. You and the aother user was of great help.

Thanks a million

ed

Nov 13 '05 #6

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

Similar topics

4
by: VK | last post by:
Dear All: I have an issue trying to parse response from xml document, for that matter I don't receive back response. I am trying to integrate UPS e-commerce online tool into our web site,...
0
by: Ian N | last post by:
Hi, I'm trying to intergrate an XML data feed with an existing website to provide currency conversions. The rates will need to be stored in a MySQL database after the feed's been updated by...
3
by: Eddie | last post by:
Hi to all I am building a database to track project expenses information. My database has 4 main tables, Employees, Activity, project info and rates. We add a project and track activities on...
1
by: Zurghew | last post by:
Hello all, I have just created a database (partially) which will bill customers for work done. However I am stuck when it is comes to different rates for different works. REQUIRED: What I...
0
by: PeteCresswell | last post by:
The one I would up was a pivot table presentation" Fund Year ReturnForYear ReturnForYearPlusPreceedingYear, ReturnForYearPlusTwoPreceedingYears.....and so-forth. But that design compromise...
3
by: milam | last post by:
Greetings, I would like to use a query result as a column name in another query, I can't seem to get this to work using Subqueries. Is there a good way to do this? Example: Table...
1
by: gertrude | last post by:
I am a Computer Systems Engineer offering fast help with Java, C/C++, PHP, JSP, XML/XSL, SQL, web design, network administration, algorithms and more! http://www.homework911.150m.com
1
by: GPD | last post by:
I thought I had done this before but cant see a way how. Am sure I once opened a table and amended some data. Anyone know if possible or how, any permissions needed from 10G EM. PS I know...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
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: 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: 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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...

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.