Database design

B

bshuemaker

I need help with creating a new data base. The requirement is to calculate
date, for example: A person is hired. This person has 180 days probation.
Instead of calculating the date manually, I would like to enter the report
date in the field Reported. After I enter the date, have Access automatically
calculate the date and put it in the database under a field called Probation.

Reported Probation
4/25/2008 10/25/2008

Any help is greatly appreciated.
 
B

BruceM

You can use the DateAdd function to find the date in 180 days, but you
chould calculate it as you go using the DateAdd function. In an unbound
text box on the form:
=DateAdd("d",180,[ReportedDate])
You could put this into a query, and use the query as the form's Record
Source, as follows:
At the top of a blank column in query design view:
Probation: DateAdd("d",180,[ReportedDate])

You could use DateAdd("m",6,[ReportedDate]) if you prefer. See Help for
more information about DateAdd.
 
K

Klatuu

It would be incorrect database design to carry the Probation date. It is a
calculated field. The correct method is to calculate the probation date
whenever you want to present it to a human. For both forms and reports, the
way to do that is with an unbound text box. the syntax is a bit different,
but in both cases you use the Control Source property of a text box
For a form, you refer to another control on the form:

=DateAdd("d",180,Me.txtReported)

The difference in a report is that you use the name of a field in the
report's record source:

=DateAdd("d",180,[Reported])

The DateAdd function will return a date 180 days from the date passes as the
date argument. Now, you example shows 4/25/2008 and 10/25/2008.

That is not 180 days, it is 183 days The correct date for 180 days is
10/22/2008.

If, in fact, your dates are correct, then you need to calculate by months:
=DateAdd("m", 6, [Reported])
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Protecting and Auto fill Columns 4
Advanced Query Question 2
dateadd query 3
Excel DateDif - why does 2007 seem different? 3
Date Calculation Challenge 3
Date Differences 3
Date search query 0
Help With Access 3

Top