printing report with date


J

jjlydon

I have Access 2003 and have dates inputed in the format mm-dd-yyyy
I want to print a report that will say "This person was born on the" dd "of" mm "in the year" yyyy.
Is is possible to extract that information from the date information that is in the table? Thanks. John
 
Ad

Advertisements

J

John W. Vinson

I have Access 2003 and have dates inputed in the format mm-dd-yyyy
I want to print a report that will say "This person was born on the" dd "of" mm "in the year" yyyy.
Is is possible to extract that information from the date information that is in the table? Thanks. John

Sure. Date formats are VERY flexible. Assuming that this field is a Date/Time
field (not a Text field which happens to contain a text string interpreted as
a date) you can set the Control Source proprety of the textbox to

="This person was born on the " & Format([datefield], "dd\ \o\f\ mm \i\n\
\t\h\e\ \y\e\a\r\ yyyy")

This will show

This person was born on the 16 of 05 in the year 1946

If you want to see May instead of 05, replace the mm in the format expression
with mmmm. The backslashes tell the Format function to take the next character
literally, not as a format string.

It's possible, with a bit more work, to show the day as 16th or 2nd or 21st,
but it would need some VBA code.
--

John W. Vinson [MVP]
Microsoft's replacements for these newsgroups:
http://social.msdn.microsoft.com/Forums/en-US/accessdev/
http://social.answers.microsoft.com/Forums/en-US/addbuz/
and see also http://www.utteraccess.com
 
Joined
Nov 2, 2012
Messages
4
Reaction score
0
John
You seem to know about dates.
Can you tell me why when I updated a date field = Date (on the 2nd of November 2012) it actually got stored as 11th of February? I know this as the stored integer is 40950 for 11th Feb
Thanks
(apologies for hijacking this thread)
 
Ad

Advertisements

J

jjlydon

I have Access 2003 and have dates inputed in the format mm-dd-yyyy

I want to print a report that will say "This person was born on the" dd "of" mm "in the year" yyyy.

Is is possible to extract that information from the date information that is in the table? Thanks. John

Many thanks. That is very helpful. John
 

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