A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Database Design
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Dates Validation for Overlapping & Gaps (Leo asked)



 
 
Thread Tools Display Modes
  #1  
Old December 19th, 2009, 07:58 AM posted to microsoft.public.access.tablesdbdesign
leo
external usenet poster
 
Posts: 236
Default Dates Validation for Overlapping & Gaps (Leo asked)

Hi there,
I need to have a table to keep employees salaries, in which each employee
may have many different salaries on different ranges of dates, with fields of
EmployeeID , StartDate, EndDate, Salary Amount. For example employee A can
have a 2000 $ monthly salary from Jan 1st to Apr 30th , but 2500$ from May
1st to Dec 31st.
Data entry could be though a form or directly from table, but there must be
a control or constrain over validity of date ranges (the span between
StartDate and EndDate) in a way that no two records overlaps each other for
the same employee and also no gap between entries. For example if Employee A
receive a salary from Jan 1st to Mar 3oth , then the same employee can not
have a record of salary for Feb 1st to Apr 30th (overlapping) or Jun 1st to
Dec 31st (leave a gap).
How can I impose such a control for date validation??
I appreciate your help.
--
Thans & Best regards
Leo, InfoSeeker
  #2  
Old December 19th, 2009, 11:00 AM posted to microsoft.public.access.tablesdbdesign
Stefan Hoffmann
external usenet poster
 
Posts: 991
Default Dates Validation for Overlapping & Gaps (Leo asked)

hi Leo,

On 19.12.2009 07:58, Leo wrote:
Data entry could be though a form or directly from table, but there must be
a control or constrain over validity of date ranges (the span between
StartDate and EndDate) in a way that no two records overlaps each other for
the same employee and also no gap between entries.

If the constraint 'no gap' is a necessary, significant business rule
then the solution is quite simple:

Use no EndDate. Store only the employee's ID, the salary and the start
date. The end date is determined by either the next records start date,
or by an external date reflecting the employee's state - fired at.

mfG
-- stefan --
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 05:24 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.