473,473 Members | 2,131 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Calculate an age

16 New Member
Hi i have already asked what to use for calculating an age and that works fine. The problem is it dosnt leave a value in the desired table.

Tables:
Employees & Holidays

I asked for a formula that would calculate time served with the company and to give a number in years. This part works except the value isnt shown in the table of employees it just stays blank? What can i do to solve this as the second part of the equasion is for the years that are returned corrispond to extra days holiday earned for long service to the company.

=DateDiff("yyyy",[Start Date],Now())+Int(Format(Now(),"mmdd")<Format([Start Date],"mmdd"))

This is the formula that i have pasted into the field "Length of Service" but no physical value is shown in the table.

If you can advise i would appreciate it.

Regards
Brian
ps only just learning this system so please be gentle lol
Dec 26 '07 #1
4 2761
FishVal
2,653 Recognized Expert Specialist
What a very special reason you have to store it in a table?
Dec 26 '07 #2
jaxjagfan
254 Recognized Expert Contributor
It really shouldn't be a stored value since the employees' time with the company changes every day. It should be a calculated value that can be displayed in a form or a report. The value, if stored, would only reflect the date it was entered (stored) vice the difference between start date and today's date.
Dec 26 '07 #3
trogenone
16 New Member
I understand what your saying the only issue being is that i was going to use the value returned for another formual in the other form [Holidays] then add the formula to work out the amount of extra time earned. Am i making this hard for myself? should i be looking at this from another angle?

I need the result in years for the age or [Length of Service] then a formula to work out the extra holiday earned e.g

3yrs = 1 extra day
4yrs = 2 extra days

Should i look at moving this field into the holiday form itself? Sorry to be a pest just trying to get this right and i must say have really enjoyed the challange. I realise its only a small database but have found i would like to learn more as these programes are very versitile.

Thank you for your help

Brian
Dec 26 '07 #4
jaxjagfan
254 Recognized Expert Contributor
I understand what your saying the only issue being is that i was going to use the value returned for another formual in the other form [Holidays] then add the formula to work out the amount of extra time earned. Am i making this hard for myself? should i be looking at this from another angle?

I need the result in years for the age or [Length of Service] then a formula to work out the extra holiday earned e.g

3yrs = 1 extra day
4yrs = 2 extra days

Should i look at moving this field into the holiday form itself? Sorry to be a pest just trying to get this right and i must say have really enjoyed the challange. I realise its only a small database but have found i would like to learn more as these programes are very versitile.

Thank you for your help

Brian
Use the working formula for LengthofService instead of the value returned within the new formula. Logically: A + B = DesiredVal then A + (C+D) = DesiredVal if B = C+D.

If you store the value you will need to run an update query each time before you run the report to ensure you are reporting the correct "extra days". If you use a formula (showing the difference between start date and today's date) to get the LengthofService then it will be dynamic and no need to do updates before report is generated.
Dec 26 '07 #5

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

Similar topics

2
by: Phil Powell | last post by:
Relevancy scores are normally defined by a MySQL query on a table that has a fulltext index. The rules for relevancy scoring will exclude certain words due to their being too short (minimum...
1
by: Building Blocks | last post by:
Hi, All I need is a simle calculate form script which contains this: A script that can handle text input, radio buttons, checkboxes, and dropdowns. Each one of these variables will contain a...
2
by: Gálos Zsuzsa | last post by:
Hi all, I need to calculate Formulas. For example: dim strFormula as string="25*(12-6)" I ned a DotNet Function to calculate this Formula (25*(12-6)=150): dim dblValue as double = 150
1
by: Robert de Ridder | last post by:
I use an asp page to display pages, where the dynamic content is in an iframe. To calculate the height of the iframe I use the calcheight function. However when trying to do this with external...
4
by: Jan Szymczuk | last post by:
I'm creating an MS Access 2000 database where I have a number of people entered using simple basic fields, Surname: SMITH Forenames: John DoB: 09/09/1958 Age:...
1
by: Ladislau S. | last post by:
Dear reader, I am an occasional user of MS Access 2000 running on Windows 98. My hobby is ship model building so I made a database for things that I want to buy. After two strokes I bin unable...
6
by: charliewest | last post by:
Can someone pls point me to or recommend the easiest way to calculate someone´s age using the TimeSpan object, in .NET CF? Isn´t there a simple way to use the TimeSpan object to calculate the...
3
by: Libber39 | last post by:
Hi everyone, Have a query on how to calculate the amount of weeks and days contained in a number in an access query. ie: the difference in days between 2 dates amounts to 17 days. I want to now...
0
by: SuzK | last post by:
I am trying to calculate in VBA in Access 2002 a moving average and update a table with the calculations. Fields in my WeeklyData table are Week Ending (date) ItemNbr (double) Sales Dollars...
6
by: rrstudio2 | last post by:
I am using the following vba code to calculate the median of a table in MS Access: Public Function MedianOfRst(RstName As String, fldName As String) As Double 'This function will calculate the...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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
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
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
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
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.