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

Home Posts Topics Members FAQ

Annual leave format

15 New Member
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
19 1809
Seth Schrock
2,965 Recognized Expert Specialist
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
SamuelTad
15 New Member
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 Recognized Expert Moderator Expert
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 Recognized Expert Moderator MVP
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 Recognized Expert Moderator MVP
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
SamuelTad
15 New Member
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 Recognized Expert Specialist
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
SamuelTad
15 New Member
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 Recognized Expert Specialist
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
SamuelTad
15 New Member
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 Recognized Expert Moderator MVP
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
SamuelTad
15 New Member
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 Recognized Expert Moderator MVP
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
SamuelTad
15 New Member
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 Recognized Expert Moderator MVP
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
SamuelTad
15 New Member
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 Recognized Expert Specialist
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 Recognized Expert Moderator Expert
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
SamuelTad
15 New Member
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
2001
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
1158
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
2365
by: Constandinos Mavromoustakis | last post by:
http://agent.csd.auth.gr/~cmavrom -------------------------------------------------- ============================================================================ = 37th Annual Simulation...
0
1991
by: Gus | last post by:
---------------------------------------------------------------------------- ------------------------------------ Call for Papers: 38th Annual Simulation Symposium Part of the 2005 Spring...
0
1752
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
1032
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
5549
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
2630
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
4299
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
4552
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...
0
7055
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
6920
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
7060
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
5365
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
4799
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
4501
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3013
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
3004
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1311
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 ...

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.