473,406 Members | 2,208 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,406 software developers and data experts.

Script for current age seems to be rounding

1
I am working in a financial program called Sage Fund Accounting, Human Resources Management. We offer life insurance as a benefit to staff and the premiums are based on age and benefit amount. I've got the age bands and premium based on age set up and that's working properly. My problem is that the formula I'm using to calculate age seems to be rounding up in certain instances. For example, I will turn 35 this year in September and will then be moved to the next age band. I am currently in the 29-34 band and will be in the 35-39 band. My formula is calculating my age now as 35 instead of 34 so I am being billed at a higher premium well before I should be.

This is the formula I am using for age: DateDiff(YY, dtmBirthday, GetDate())

I cannot have any quotes "" in the formula, I tried YYYY instead of YY, I tried Now instead of GetDate()) and I am getting frustrated because it seems like this software has "special" conditions for the script that it will accept.

I sure would appreciate help that anyone can offer.
Feb 13 '13 #1
1 1357
Rabbit
12,516 Expert Mod 8TB
When you use years, it just subtracts one year from another.

Use months and then divide by 12. This can still be inaccurate if it's run during the month of their birthday.

If you need it more accurate, use days and divide by 365.25.

And if you need absolute accuracy, use days, subtract the number of leap years, and then divide by 365.
Feb 13 '13 #2

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

Similar topics

6
by: David | last post by:
Hey folks, I somehow managed to create a script that locks up Mozilla (1.3) tight. Here's the culprit, perhaps y'all can provide some insight into what the trouble is. (This script was cobbled...
2
by: Archer | last post by:
I wanna to run ms script debugger to debug my web including javascript code. but when I click 'Yes' in the IE bug-found message box there is no reaction on it.the script debugger seems unused.What...
1
by: jeffrey4 | last post by:
I'm trying to write a script (my first) that loops through some table rows and gets some data from another page using gm_xmlhttprequests. It works if I keep the loop to one, but if I try and loop...
3
by: Tobius | last post by:
I want to be able to define a custom onerror event that detects an attempt to call a known function and load a file if it's not already loaded and re-call the function. The only problem is that any...
5
by: yawnmoth | last post by:
<body onload="alert('test')"> <script>location = "http://www.google.com"</script> </body> ....and... <body onload="alert('test')"></body> <script>location = "http://www.google.com"</script>...
9
by: Synapse Syndrome | last post by:
Hi I've been given what I am told is a PHP script to be used on my server. I do not know any PHP. I am trying to use a feature of a program called ArchiCAD. This feauture allows CAD drawing...
15
by: Peter Michaux | last post by:
Hi, In the following snip of and HTML page, is there a specification guarantee that the foo element will be parsed and available as part of the DOM by the time the script executes? That is,...
1
by: bbammes | last post by:
I'm writing a click tracking program which calls a remote PHP script when a user clicks a link. My javascript is: <script type="text/javascript"> //<! ); ?>&clientaddress=<?php echo urlencode(...
5
by: deppeler | last post by:
Can someone look at this for me: I am trying to set up a script to edit an item in a flat file DB but I don't seem to be getting the data to the Photoedit script. It seems to be reading the 1st line...
15
by: Lawrence Krubner | last post by:
Does anything about this script look expensive, in terms of resources or execution time? This script dies after processing about 20 or 25 numbers, yet it leaves no errors in the error logs. This is...
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
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...
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
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
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
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,...
0
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...

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.