Default Value for a Date

G

Guest

Hi, I am trying to get a cell in a table to auto calculate the date of a 90
day eval for employee's. i have a "Date Hire" and i would like the default
value of "90 Day Eval" to be 90 days after the Date Hire. I have tried a
bunch of things including various versions of what is below and entering it
into the default value box in my tables design view

= ([Date Hire] = 90d)

and

DateDiff("d", [Date Hire], ([Date Hire] + 90))

Thanks for any help
 
F

fredg

Hi, I am trying to get a cell in a table to auto calculate the date of a 90
day eval for employee's. i have a "Date Hire" and i would like the default
value of "90 Day Eval" to be 90 days after the Date Hire. I have tried a
bunch of things including various versions of what is below and entering it
into the default value box in my tables design view

= ([Date Hire] = 90d)

and

DateDiff("d", [Date Hire], ([Date Hire] + 90))

Thanks for any help

Why? As long as you have the [DateHire] saved, anytime you need to
know the 90 day Eval date, simply compute it.
In a query:
90DayEval:[DateHire] + 90

On a form or in a report:
Using an unbound text control:
=[DateHire] + 90

This calculation should NOT be saved in any table.
 
G

Guest

Thanks guys, i got what i needed by combineing what both of you offered. In
my 90 day eval Query i put as a critera for date hire

([Date Hire]+90)>Now()

Then in my report i made a text box and had as a control source

=[Date Hire]+90
 
F

fredg

Thanks guys, i got what i needed by combineing what both of you offered. In
my 90 day eval Query i put as a critera for date hire

([Date Hire]+90)>Now()

Then in my report i made a text box and had as a control source

=[Date Hire]+90

kyle said:
Hi, I am trying to get a cell in a table to auto calculate the date of a 90
day eval for employee's. i have a "Date Hire" and i would like the default
value of "90 Day Eval" to be 90 days after the Date Hire. I have tried a
bunch of things including various versions of what is below and entering it
into the default value box in my tables design view

= ([Date Hire] = 90d)

and

DateDiff("d", [Date Hire], ([Date Hire] + 90))

Thanks for any help

Now you're cookin'!
But... Now() includes a time value. Unless you wish to return records
on that date which are, for instance from 2:15 PM on, and which would
change depending upon the actual time of day you are running the code)
you would be better off using Date().

([Date Hire]+90)>Date()
 

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

Top