Set Date Value to previous day of current day

G

Guest

In my attendance register I have my date field set to Now()
But since the attendance is not completed until the following day, I would
like this field to show the previous day from when an entry is being made.

Ex. Attendance entry being made 07-Aug-07, would like the default value to be
06-Aug-07 so this doesn't have to be entered manually. [Date] is the control.

Any suggestions?

Thanks for any help provided!
 
J

Jeff Boyce

You did say "any suggestions?"...<g>

Don't call your field [Date] -- this is a reserved word in Access and will
only confuse both of you.

If you are using the Default Value property to fill in a date, and if you
don't care about what time of date, don't use Now() (that gives date/time)
.... instead, use Date().

If you don't actual want (today's) Date(), you could use something like:

Date()-1

to get yesterday's date.


Regards

Jeff Boyce
Microsoft Office/Access MVP
 
G

Guest

Thank you very much!!!! For all the info. Simple but very effective.

Thanks again, it worked great.

Jeff Boyce said:
You did say "any suggestions?"...<g>

Don't call your field [Date] -- this is a reserved word in Access and will
only confuse both of you.

If you are using the Default Value property to fill in a date, and if you
don't care about what time of date, don't use Now() (that gives date/time)
.... instead, use Date().

If you don't actual want (today's) Date(), you could use something like:

Date()-1

to get yesterday's date.


Regards

Jeff Boyce
Microsoft Office/Access MVP

Roby said:
In my attendance register I have my date field set to Now()
But since the attendance is not completed until the following day, I would
like this field to show the previous day from when an entry is being made.

Ex. Attendance entry being made 07-Aug-07, would like the default value to
be
06-Aug-07 so this doesn't have to be entered manually. [Date] is the
control.

Any suggestions?

Thanks for any help provided!
 

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