473,508 Members | 2,515 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Adding a set number of days to a given date based on criteria in another field

Hi can anyone suggest a fix for this... as I am a novice in access.

I have created a training table with the following fields

Employee Name - joe
Training Received - Fork lift
Date Received - 20/6/07
Certificate - yes

What I want to create is a renewal date for this training, there are
numerous training courses being delivered so the data in the training
received field will vary.
So the renewal date will vary also as some training will be renewed in
1 years time or 6mths or 2 years time, but this is purely based on the
type of training received.
Is there a way that this can be calculated in a query so that i can
then point a form to this query and when the information is input for
a new batch of training then it will give me the renewal date based on
what has been input inthe date received field and the training
received field.

Is this very complex, as I am finding it very difficult.
Any help would be much appreciated

Jun 20 '07 #1
2 2551
On Wed, 20 Jun 2007 02:41:51 -0700, dy****@crosslandtankers.com wrote:
>Hi can anyone suggest a fix for this... as I am a novice in access.

I have created a training table with the following fields

Employee Name - joe
Training Received - Fork lift
Date Received - 20/6/07
Certificate - yes

What I want to create is a renewal date for this training, there are
numerous training courses being delivered so the data in the training
received field will vary.
So the renewal date will vary also as some training will be renewed in
1 years time or 6mths or 2 years time, but this is purely based on the
type of training received.
Is there a way that this can be calculated in a query so that i can
then point a form to this query and when the information is input for
a new batch of training then it will give me the renewal date based on
what has been input inthe date received field and the training
received field.
You can use Access functions in a query, but it seems to me that your Renewal date will be different based on the type
of training received ... in this case, you'd probably need to store the Renewal date somewhere. I don't know what your
database strucutre is, but basically you'd store it in the same table where you'd store the training + Employee info ...
I'd presume you have something like this:

tEmployees
------------------
lEmployeeID [PK]
sFirstName
sLastName
sEmpNumber
etc

tTraining
---------------
lTrainingID [PK]
sDescription
dRenewalPeriod (i.e. # of months for renewal)

tEmployeeTraining
---------------------------
lEmployeeID
lTrainingID
dDateOfTraining (stores the date training completed)
dRenewalDate (stores the date the renewal is needed)

From this point, when you add a new record to tEmployeeTraining, you'd use tTraining.dRenewalPeriod to calculate the
value to store in dRenewalDate. You'd then build a query that joins the three tables above to display your data and show
what employees have taken various Training courses, and when their Renewal dates for those training courses are.

IN general, it's not a good idea to store calculated values (the dRenewalDate) since you could easily calculate the
Renewal date by adding the tTraining.dRenewalPeriod to the value stored in tEmployeeTraining.dDateOfTraining, but in my
experience these things tend to be somewhat fluid ... for example, this year the company may require that all Employees
be retrained on the forklift every 2 years, but thier insurance company may come in and audit the training and require
that forklift operaters be retrained every 6 months ... in this case, if you change the dRenewalPeriod to 6, you'd
invalidate every legacy record that depended on that value. This may not be applicable in your case, and you may need a
different set of tables and/or relationships.

>
Is this very complex, as I am finding it very difficult.
Any help would be much appreciated
Scott McDaniel
scott@takemeout_infotrakker.com
www.infotrakker.com
Jun 20 '07 #2
On 20 Jun, 11:23, Scott McDaniel <scott@NoSpam_Infotrakker.comwrote:
On Wed, 20 Jun 2007 02:41:51 -0700, dym...@crosslandtankers.com wrote:
Hi can anyone suggest a fix for this... as I am a novice in access.
I have created a training table with the following fields
Employee Name - joe
Training Received - Fork lift
Date Received - 20/6/07
Certificate - yes
What I want to create is a renewal date for this training, there are
numerous training courses being delivered so the data in the training
received field will vary.
So the renewal date will vary also as some training will be renewed in
1 years time or 6mths or 2 years time, but this is purely based on the
type of training received.
Is there a way that this can be calculated in a query so that i can
then point a form to this query and when the information is input for
a new batch of training then it will give me the renewal date based on
what has been input inthe date received field and the training
received field.

You can use Access functions in a query, but it seems to me that your Renewal date will be different based on the type
of training received ... in this case, you'd probably need to store the Renewal date somewhere. I don't know what your
database strucutre is, but basically you'd store it in the same table where you'd store the training + Employee info ...
I'd presume you have something like this:

tEmployees
------------------
lEmployeeID [PK]
sFirstName
sLastName
sEmpNumber
etc

tTraining
---------------
lTrainingID [PK]
sDescription
dRenewalPeriod (i.e. # of months for renewal)

tEmployeeTraining
---------------------------
lEmployeeID
lTrainingID
dDateOfTraining (stores the date training completed)
dRenewalDate (stores the date the renewal is needed)

From this point, when you add a new record to tEmployeeTraining, you'd use tTraining.dRenewalPeriod to calculate the
value to store in dRenewalDate. You'd then build a query that joins the three tables above to display your data and show
what employees have taken various Training courses, and when their Renewal dates for those training courses are.

IN general, it's not a good idea to store calculated values (the dRenewalDate) since you could easily calculate the
Renewal date by adding the tTraining.dRenewalPeriod to the value stored in tEmployeeTraining.dDateOfTraining, but in my
experience these things tend to be somewhat fluid ... for example, this year the company may require that all Employees
be retrained on the forklift every 2 years, but thier insurance company may come in and audit the training and require
that forklift operaters be retrained every 6 months ... in this case, if you change the dRenewalPeriod to 6, you'd
invalidate every legacy record that depended on that value. This may not be applicable in your case, and you may need a
different set of tables and/or relationships.
Is this very complex, as I am finding it very difficult.
Any help would be much appreciated

Scott McDaniel
scott@takemeout_infotrakker.comwww.infotrakker.com- Hide quoted text -

- Show quoted text -
I am sorry but I don seem to be fully understanding what you have
explained.
Do I create a new field in the employee training table called renewal
date? if so how do I get it to add the renewal period field to the
date of training or do I do this in a query and if so how...

Sorry...any detail would be much appreciated.

Jun 29 '07 #3

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

Similar topics

2
14143
by: Rimdur | last post by:
I am trying to get a difference between two dates calculated in a query. I have Sales_Date as the first one, and Date() as the second one. How would I put the difference of these two days into a...
2
2068
by: dixie | last post by:
I have a report which is printed daily. It is a list of people. A person can be put on this list for one day, which is easyily achieved from a simple form. My problem is that a person can also...
6
2496
by: Robin S. | last post by:
**Eric and Salad - thank you both for the polite kick in the butt. I hope I've done a better job of explaining myself below. I am trying to produce a form to add products to a table (new...
12
6337
by: Steve Elliott | last post by:
I have a query set up to gather together data between two specified dates. Shown in the query column as: Between #24/09/2004# And #01/10/2004# Is it possible to enter several different date...
1
1468
by: KEVIN97810 | last post by:
hello to all, I have a date field in my table (last, first, address, contact, Date) and i want to write a select statement example based on the date field. Give me 30 days, 30 to 90, 90 to 100...
29
9028
by: james | last post by:
I have a problem that at first glance seems not that hard to figure out. But, so far, the answer has escaped me. I have an old database file that has the date(s) stored in it as number of days. An...
1
2002
damonreid
by: damonreid | last post by:
Access 2003 Microsoft Windows XP Pro Hey, I am currently pulling my hair out here. I have a Form for adding new projects to a database, the only problem is that when I close the form it doesn't...
2
4434
by: srusskinyon | last post by:
I need some help getting unique records from our database! I work for a small non-profit homeless shelter. We keep track of guest information as well as what services we have offered for...
1
4879
by: swethak | last post by:
Hi, I am desiging the calendar application for that purpose i used the below code. But it is for only displys calendar. And also i want to add the events to calendar. In that code displys the...
0
7133
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
7336
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
7405
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...
0
7504
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5643
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5059
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
3214
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1568
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
435
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.