Hi there
In my database, I have used the following calculation to determine a
person's years of service.
YearsOfService: DateDiff("yyyy",[HireDate],Date())
-IIf(Format([HireDate],"mmdd")>Format(Date(),"mmdd"),1,0)
A t the moment, the result is rounded to the nearest whole number.
I would like to see at least 2 decimal places. At the moment, if someone has
been with the company less than 1 year, I get 0 years. I would like to see if
it's .75 years or .5 years, etc.
Thank you in advance for your help.
|
|
0
|
|
|
|
Reply
|
Utf
|
3/15/2010 3:20:01 AM |
|
forest8,
Under properties format the field on you form to fixed = 2 (if you want to
always have to decimal places) or Format = Standard and set Decimal Places
to 2
--
Gina Whipp
2010 Microsoft MVP (Access)
"I feel I have been denied critical, need to know, information!" - Tremors
II
http://www.regina-whipp.com/index_files/TipList.htm
"forest8" <forest8@discussions.microsoft.com> wrote in message
news:540F2F2A-5D02-45A4-9BC3-8C4C0F112987@microsoft.com...
Hi there
In my database, I have used the following calculation to determine a
person's years of service.
YearsOfService: DateDiff("yyyy",[HireDate],Date())
-IIf(Format([HireDate],"mmdd")>Format(Date(),"mmdd"),1,0)
A t the moment, the result is rounded to the nearest whole number.
I would like to see at least 2 decimal places. At the moment, if someone has
been with the company less than 1 year, I get 0 years. I would like to see
if
it's .75 years or .5 years, etc.
Thank you in advance for your help.
|
|
0
|
|
|
|
Reply
|
Gina
|
3/15/2010 3:33:53 AM
|
|
Hi,
DateDiff("yyyy",...) always returns a whole number of years (which is why
you have to subtract one if the HireDate is greater than the current date).
So to get a fraction of year, you'll have to use:
YearsOfService: DateDiff("m",",[HireDate],Date()) / 12
You can then set the format to display as many or as few decimal places as
you like.
Cheers and HTH,
Alex.
"forest8" wrote:
> Hi there
>
> In my database, I have used the following calculation to determine a
> person's years of service.
>
> YearsOfService: DateDiff("yyyy",[HireDate],Date())
> -IIf(Format([HireDate],"mmdd")>Format(Date(),"mmdd"),1,0)
>
> A t the moment, the result is rounded to the nearest whole number.
>
> I would like to see at least 2 decimal places. At the moment, if someone has
> been with the company less than 1 year, I get 0 years. I would like to see if
> it's .75 years or .5 years, etc.
>
> Thank you in advance for your help.
|
|
0
|
|
|
|
Reply
|
Utf
|
3/15/2010 3:48:01 AM
|
|
Hi
Will I have a problem if this person no longer works in my company?
There is an Exit Date in my database.
"Tokyo Alex" wrote:
> Hi,
>
> DateDiff("yyyy",...) always returns a whole number of years (which is why
> you have to subtract one if the HireDate is greater than the current date).
>
> So to get a fraction of year, you'll have to use:
> YearsOfService: DateDiff("m",",[HireDate],Date()) / 12
>
> You can then set the format to display as many or as few decimal places as
> you like.
>
> Cheers and HTH,
> Alex.
>
>
> "forest8" wrote:
>
> > Hi there
> >
> > In my database, I have used the following calculation to determine a
> > person's years of service.
> >
> > YearsOfService: DateDiff("yyyy",[HireDate],Date())
> > -IIf(Format([HireDate],"mmdd")>Format(Date(),"mmdd"),1,0)
> >
> > A t the moment, the result is rounded to the nearest whole number.
> >
> > I would like to see at least 2 decimal places. At the moment, if someone has
> > been with the company less than 1 year, I get 0 years. I would like to see if
> > it's .75 years or .5 years, etc.
> >
> > Thank you in advance for your help.
|
|
0
|
|
|
|
Reply
|
Utf
|
3/15/2010 5:05:01 AM
|
|
Hi,
No, you shouldn't have a problem. Simply replace the "Date()" in the
expression with "[ExitDate]".
Cheers,
Alex.
"forest8" wrote:
> Hi
>
> Will I have a problem if this person no longer works in my company?
>
> There is an Exit Date in my database.
>
> "Tokyo Alex" wrote:
>
> > Hi,
> >
> > DateDiff("yyyy",...) always returns a whole number of years (which is why
> > you have to subtract one if the HireDate is greater than the current date).
> >
> > So to get a fraction of year, you'll have to use:
> > YearsOfService: DateDiff("m",",[HireDate],Date()) / 12
> >
> > You can then set the format to display as many or as few decimal places as
> > you like.
> >
> > Cheers and HTH,
> > Alex.
> >
> >
> > "forest8" wrote:
> >
> > > Hi there
> > >
> > > In my database, I have used the following calculation to determine a
> > > person's years of service.
> > >
> > > YearsOfService: DateDiff("yyyy",[HireDate],Date())
> > > -IIf(Format([HireDate],"mmdd")>Format(Date(),"mmdd"),1,0)
> > >
> > > A t the moment, the result is rounded to the nearest whole number.
> > >
> > > I would like to see at least 2 decimal places. At the moment, if someone has
> > > been with the company less than 1 year, I get 0 years. I would like to see if
> > > it's .75 years or .5 years, etc.
> > >
> > > Thank you in advance for your help.
|
|
0
|
|
|
|
Reply
|
Utf
|
3/15/2010 5:18:01 AM
|
|
On Sun, 14 Mar 2010 22:05:01 -0700, forest8
<forest8@discussions.microsoft.com> wrote:
>Will I have a problem if this person no longer works in my company?
>
You can get finer granularity and handle both current and fromer employees
with:
YearsOfService: Round(DateDiff("d",",[HireDate],NZ([ExitDate],Date())) /
365,2)
--
John W. Vinson [MVP]
|
|
0
|
|
|
|
Reply
|
John
|
3/15/2010 6:21:40 AM
|
|
Jhall@myglnc.com
"forest8" <forest8@discussions.microsoft.com> wrote in message
news:540F2F2A-5D02-45A4-9BC3-8C4C0F112987@microsoft.com...
> Hi there
>
> In my database, I have used the following calculation to determine a
> person's years of service.
>
> YearsOfService: DateDiff("yyyy",[HireDate],Date())
> -IIf(Format([HireDate],"mmdd")>Format(Date(),"mmdd"),1,0)
>
> A t the moment, the result is rounded to the nearest whole number.
>
> I would like to see at least 2 decimal places. At the moment, if someone
> has
> been with the company less than 1 year, I get 0 years. I would like to see
> if
> it's .75 years or .5 years, etc.
>
> Thank you in advance for your help.
|
|
0
|
|
|
|
Reply
|
James
|
3/28/2010 4:01:55 PM
|
|
"forest8" <forest8@discussions.microsoft.com> wrote in message
news:540F2F2A-5D02-45A4-9BC3-8C4C0F112987@microsoft.com...
> Hi there
>
> In my database, I have used the following calculation to determine a
> person's years of service.
>
> YearsOfService: DateDiff("yyyy",[HireDate],Date())
> -IIf(Format([HireDate],"mmdd")>Format(Date(),"mmdd"),1,0)
>
> A t the moment, the result is rounded to the nearest whole number.
>
> I would like to see at least 2 decimal places. At the moment, if someone
> has
> been with the company less than 1 year, I get 0 years. I would like to see
> if
> it's .75 years or .5 years, etc.
>
> Thank you in advance for your help.
|
|
0
|
|
|
|
Reply
|
James
|
4/2/2010 2:31:45 PM
|
|
|
7 Replies
468 Views
(page loaded in 0.131 seconds)
Similiar Articles: Years of Service Calculation to 2 decimal places - microsoft ...Hi there In my database, I have used the following calculation to determine a person's years of service. YearsOfService: DateDiff("yyyy",[Hire... Round to 2 decimal places - microsoft.public.access.forms ...Years of Service Calculation to 2 decimal places - microsoft ... Round to 2 decimal places - microsoft.public.access.forms ... I want to round the calculation to 2 decimal ... Displaying decimal places in Access - microsoft.public.access ...Years of Service Calculation to 2 decimal places - microsoft ... Calculating averages on a form - microsoft.public.access ..... property to 0, the value is showing with ... End of service calculation - microsoft.public.access.forms ...I want to round the calculation to 2 decimal places: eg. ... varNumber)) * dblPower + 0.5)) / dblPower End ... Years of Service Calculation to 2 decimal places - microsoft ... How to determine the number of decimal places in a number ...Years of Service Calculation to 2 decimal places - microsoft ... Time Value Multiplied for Round Trip Calculation - microsoft ..... been marketed in Europe and American ... Rounding off numbers to 2 decimal places. - microsoft.public ...Years of Service Calculation to 2 decimal places - microsoft ... You need to contact your mail service for any server ... has happened to me a couple of times over the ... Calculating Moon Phases - microsoft.public.vb.general.discussion ...Years of Service Calculation to 2 decimal places - microsoft ... phases duration shows in decimal . - microsoft.public.project ..... phases showing duration in decimal ... phases duration shows in decimal . - microsoft.public.project ...Years of Service Calculation to 2 decimal places - microsoft ... Time Value Multiplied for Round Trip ... to microsecond accuracy which 8 decimal places ... Current Date + 3 years - microsoft.public.accessYears of Service Calculation to 2 decimal places - microsoft ..... always returns a whole number of years (which is why > you have to subtract one if the HireDate is ... Currency and the number of decimal places - microsoft.public ...... sure only 2 decimal places ... four, decimal places. You need to Round or truncate the calculations to two decimals at the time the calculation is done. ... number of years ... Years of Service Calculation to 2 decimal places DataBaseHi there In my database, I have used the following calculation to determine a person's years of service. YearsOfService: DateDiff(yyyy,[HireDate],Date() Years of Service Calculation to 2 decimal places [General]Hi there In my database, I have used the following calculation to determine a person's years of service. YearsOfService: DateDiff("yyyy",[HireDate],Date()) -IIf ... Answer : Years of Service Calculation to 2 decimal placesYears of Service Calculation to 2 decimal places - answer - Hi there In my database, I have used the following calculation to determine a person's years of service. Years of Service Calculation to 2 decimal places - microsoft ...Hi there In my database, I have used the following calculation to determine a person's years of service. YearsOfService: DateDiff("yyyy",[Hire... How to Calculate Decimals | eHow.comMove the decimal point two places to the left to convert a percentage to the decimal ... Changing a fraction to a decimal on a calculator is simple. It only requires ... 7/20/2012 2:46:19 AM
|