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

Annual leave format

Hi All,
Am trying some Annual leave database.
It's Idea is

Annual leave:[Date of Employ]+1,for 1st year=14 days
for 2nd year=14+(14+1)
.
.
.
I need the expression which execute Annual leave in my case. with regard!
Aug 5 '14 #1

✓ answered by NeoPa

Right. Now we have a question to work with that makes some sense :-)

@Seth.
Your formula doesn't appear to be an accurate reflection of the requirement. If you consider that y is the number of whole years worked then you would need :
Expand|Select|Wrap|Line Numbers
  1. 14 + IIf(y < 11, y, 11)
@Samuel.
You still haven't given us the position of the person it was who requested this from you. Please do so ASAP. Failure to do so may result in the deletion of this thread.

Although this question now makes sense it is important to understand that this formula results in a different value depending on the date that is used to determine y. If you're happy that Date() (IE. The current date.) is used then this is straightforward enough. If not, then you need to get a date from somewhere. Probably a form, but certainly specified somewhere.

Unfortunately, even here we have a problem. Calculating an accurate value of whole years is not as easy as it should be. Checking it is, but calculating it isn't. DateDiff() returns a value of the nearest number of years. This is not a great deal of use and not appropriate for your needs :-(

The logic for calculating y (and then [Available Days]) in this scenario would be :
Expand|Select|Wrap|Line Numbers
  1. y: Year(Date())-Year([Date of Employ])-IIf(Format(Date(),'mmdd')<Format([Date of Employ]),'mmdd'),1,0)
  2. Available Days: 14 + IIf(y < 11, y, 11)
As I say, not too straightforward.

19 1807
Seth Schrock
2,965 Expert 2GB
I think that I understand your policy to be Years of Employment * 14 + 1. I'm guessing that there is probably a cutoff, otherwise once you have worked 13 years, you would only have to work half the year. So we need a more detailed explanation of what the policy is.

Also are you looking for a VBA or SQL solution?
Aug 5 '14 #2
Thanks for your concern!@Seth
No matter how many year employee can work in the company.However,employee has to consume entitled no of days within the year before new Entitle days released.The first year entitled annual leave shall be used on that first year only unless some exceptional case.I need SQL based.
Entitled Days for 1st,begin with 14 days
2nd year,14 days + 15 Days = 29 Days
it goes like this.
Aug 6 '14 #3
zmbd
5,501 Expert Mod 4TB
Can you show your work?

What I would do is a variation on Allen Browne's Age() Function

Using this function in the query, feed it the employ's hire date. Now you have the "Age" of the employee with the company.
(personally, I'd do this in one field)

You can then use iif(age=>1,14+(14+(age-1)),14)
(personally, I'd do this in a second field... however, could do this all in one field)

As written, this will default to 14 days from age 0 thru age 1.999999(...), You will need additional logic if you don't want to award before the 1 year anniversary and if you need a cutoff such as only 60 days, etc... you can do this with nested IIF() or, my preference would be, Switch Funciton (,as I find nested iif() to be difficult to maintain).
Aug 6 '14 #4
Rabbit
12,516 Expert Mod 8TB
So... continuing the trend... the third year they get 14+15+16 = 45 days of leave in a year??? I want to work at your company. After enough years, I won't have to work at all.
Aug 6 '14 #5
NeoPa
32,556 Expert Mod 16PB
Samuel. Like Rabbit, I think you have misunderstood what you've been asked to do.

While it is not unusual for an employee to be awarded an extra day's leave per year of employment up to some maximum, it is extremely unusual, not to say obviously daft, to get an extra fortnight for every year worked. It is also unheard of for there to be no maximum set.

Please check what it is you have been asked to do and come back here and post two things for us :
  1. The corrected situation explained clearly and logically.
  2. The position (title) of the person it was who asked you to do this for them.

With this information we can proceed in a sensible manner.
Aug 6 '14 #6
Thank you All.I was stressed only on code rather than fulfilling all requirements,but i understood that maximum days entitled is a part of a code so it is 25 days.
@ NeoPa my inquiry is
1.Code which Implement annual leave.
2.You can take the same Entitled Days for employee.
***One thing to remind if i get any clue i will manage in for different position.Thanks!!
Aug 8 '14 #7
Seth Schrock
2,965 Expert 2GB
I'm confused. In your first post you say that the second year you get 14+(14+1) which equals 29 so how is the maximum days only 25?
Aug 8 '14 #8
Sorry inconvenience that i made @ Seth!would mind able to understand me in such manner.
1st year grant 14 days
2nd year grant 15 days
.
.
.
12nd year granted 25 days.So it will stop at this time.So it is not the total number of days granted rather i want mentioned that granted date increment with 1 day for every consecutive years.Thank you!!
Aug 8 '14 #9
Seth Schrock
2,965 Expert 2GB
Okay. Starting to make sense. So the formula would be 14 + (y - 1) where y is the number of years worked.
Expand|Select|Wrap|Line Numbers
  1. Year   Formula        Days off
  2. 1      14 + (1 - 1)   14
  3. 2      14 + (2 - 1)   15
  4. 3      14 + (3 - 1)   16
  5. ...
  6. 11     14 + (11 - 1)  24
  7. 12     14 + (12 - 1)  25
Is this correct?
Aug 8 '14 #10
Thanks Seth your formula is workable.In my database there is Date of employ column in DD.MM.YYYY format.How can number of years worked count by taking Date of Employ .With regard!!!!
Finally my intention is the system to show me this,
Available Days:14+(Nz[Date of employ]-1)
Aug 9 '14 #11
NeoPa
32,556 Expert Mod 16PB
Right. Now we have a question to work with that makes some sense :-)

@Seth.
Your formula doesn't appear to be an accurate reflection of the requirement. If you consider that y is the number of whole years worked then you would need :
Expand|Select|Wrap|Line Numbers
  1. 14 + IIf(y < 11, y, 11)
@Samuel.
You still haven't given us the position of the person it was who requested this from you. Please do so ASAP. Failure to do so may result in the deletion of this thread.

Although this question now makes sense it is important to understand that this formula results in a different value depending on the date that is used to determine y. If you're happy that Date() (IE. The current date.) is used then this is straightforward enough. If not, then you need to get a date from somewhere. Probably a form, but certainly specified somewhere.

Unfortunately, even here we have a problem. Calculating an accurate value of whole years is not as easy as it should be. Checking it is, but calculating it isn't. DateDiff() returns a value of the nearest number of years. This is not a great deal of use and not appropriate for your needs :-(

The logic for calculating y (and then [Available Days]) in this scenario would be :
Expand|Select|Wrap|Line Numbers
  1. y: Year(Date())-Year([Date of Employ])-IIf(Format(Date(),'mmdd')<Format([Date of Employ]),'mmdd'),1,0)
  2. Available Days: 14 + IIf(y < 11, y, 11)
As I say, not too straightforward.
Aug 9 '14 #12
Thanks @Neopa,OK to draw the company i work for is a Herbal farm,It's man power is very few management stuff and 400 ordinary staff.even if they differ in position but Similar Entitled Date .So our intention is to manege the 400 people annual leave system.
Aug 9 '14 #13
NeoPa
32,556 Expert Mod 16PB
OK. Although that doesn't actually answer the question it does give me enough information to know this is not an educational assignment. Good enough.

Now we need to know if this has solved your problem or if you are still looking for further help with this issue?
Aug 10 '14 #14
Thank you @NeoPa!!
one more question!
Available Days:14+IIf(Y<11,Y,11) on this do not take 14 is a constant rather first year entitle date.So it can be zero when employee use it.Remember am an Amateur on programming so i hope you tolerate me.
Aug 13 '14 #15
NeoPa
32,556 Expert Mod 16PB
Samuel.

We try to be patient with new posters who struggle to get things quite right :-)

In this case I need you to explain the clarification of your problem more clearly. It is important that it is not a new question as that would require being asked in a separate thread. In this case I think it is simply a clarification.

Unfortunately I don't understand what it is you're trying to explain. Please post it again but more carefully this time. Read it through before submitting to make sure it makes sense.
Aug 14 '14 #16
Ok sir am tying to explain it better.well every employee grants 14 days entitle date for 1st year and continue 15 ... where,year=12.
So far my question regarding available days i mentioned were mistakes.The first entitled date which is 14 days take as a constant to calculate the Available days.But it is clear that employee can take leave so available days automatically decrease so consider my point and support me to finish my project.
Available Days:14+iif(Y<11,Y,11)
Aug 20 '14 #17
Seth Schrock
2,965 Expert 2GB
So you would need a field that stores the number of vacation days used. Then, all you need to do is use the formula given and then subtract the value from the new field to get the days left.
Aug 20 '14 #18
zmbd
5,501 Expert Mod 4TB
SamuelTad
Question 1) How to calculate the vacation benefit?
I believe that this has been asked and answered at this point.

Question 2) How to keep track of the used vacation and remainder of available benefit?
I also believe that this has been asked and answered at this point. As NeoPa as stated, if you need further assistance with this, please start a new thread. You can refer to this thread for context.
Aug 20 '14 #19
Wow!!! Thank you all who support me a lot to change an ideal one in to real Database.
Aug 22 '14 #20

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

Similar topics

0
by: Constandinos Mavromoustakis | last post by:
Dear all, first we apologize if you receive multiple copies of this announcement. please see below if you are interested. Thank you in advance....
0
by: Scott Abel | last post by:
Tri-XML 2005 -- Annual Conference, July 28-29, 2005 -- McKimmon Center (NC State University) Info: http://www.trixml.org/confindex.shtml Three days -- only $199 Come to Tri-XML 2005 and learn...
0
by: Constandinos Mavromoustakis | last post by:
http://agent.csd.auth.gr/~cmavrom -------------------------------------------------- ============================================================================ = 37th Annual Simulation...
0
by: Gus | last post by:
---------------------------------------------------------------------------- ------------------------------------ Call for Papers: 38th Annual Simulation Symposium Part of the 2005 Spring...
0
by: Karatza Helen | last post by:
Our apologies if you have received multiple copies -------------------------------------------------- Call for Papers: 38th Annual Simulation Symposium Part of the 2005 Spring Simulation...
0
by: mannaikarthik | last post by:
Hi, Currently I am designing some reports in ASP.NET using SQL Server reporting services-2000 I want to format a report item (a column in the report) like the following. Just consider a...
11
by: jjkeeper | last post by:
Hi, I need to create an annual leave Database for the company. I admit I was a complete novice at this. But I got thrown the job and I have to do it. So here's what I get so far, but I got pretty...
0
by: ayu1980 | last post by:
hi can someone help me... im new PHP leaner.. i want to develop staff movement system. I want to display all record in dbase from table leave mgmt which is supervisor can choose 3 status...
5
by: AccessBeetle | last post by:
There is an application created in Access 2003 and VBA. It is used by 18 different locations. 17 of them are running perfectly fine but one location has following problem: There is report called...
6
by: Johnny Denver | last post by:
I'm not that experienced with database design and I cannot figure out the best way to design this. I have annual hourly data (8760 values) for a million sites. The total size of the data is not a...
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
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: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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...
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...

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.