Year only in date

Z

ZOYA

I need to put the year only on a report in the following sentence.

Witnessed this (blank) day of (blank), YEAR

I had to manually change all the dates to 2009 - but if I'm not here next
year, I want it to happen automatically, as no one here knows Access. Can
anyone help?
 
R

Roger Carlson

Format(Date(),"yyyy") will automatically show the year of whatever day the
report is run. The entire sentence can be created like this:

="Witnessed this " & Format(Date(),"d") & " day of " & Format(Date(),"mmm")
& ", " & Format(Date(),"yyyy")

On my website (www.rogersaccesslibrary.com), is a small Access database
sample called "Ordinals.mdb" which illustrates how put the "st", "nd", or
"th" after the day number automatically as well. You can find it here:
http://www.rogersaccesslibrary.com/forum/forum_posts.asp?TID=305

--
--Roger Carlson
MS Access MVP
Access Database Samples: www.rogersaccesslibrary.com
Want answers to your Access questions in your Email?
Free subscription:
http://peach.ease.lsoft.com/scripts/wa.exe?SUBED1=ACCESS-L
 
M

M Skabialka

Create a text box on your report, rather than a label.
In the control source for this text box:
="Witnessed this day of , " & DatePart("yyyy",Date())

This assumes that you will be creating the report in the year that you use
it. Adjust the spaces in the report for the day and month as needed.

Mich
 
Z

ZOYA

Thanks Mich - worked perfectly!

M Skabialka said:
Create a text box on your report, rather than a label.
In the control source for this text box:
="Witnessed this day of , " & DatePart("yyyy",Date())

This assumes that you will be creating the report in the year that you use
it. Adjust the spaces in the report for the day and month as needed.

Mich
 
Top