Format Date

R

Roger Bell

I have the following code in a Text Bax in a Report:

=Trim("Born on" & " " & [Date of birth] & " " & ("in" & " " & [Place of
Birth] & " " & Trim("and baptised this day" & " " & [Date of Baptism])))

What I would like, is to add the format command to convert the dates to dddd
mmm yyyy

Could anyone tell me the corrrect syntax and where this should be placed?
Many thanks for any assistance.
 
J

John Spencer

You need the format function.

=Trim("Born on " & Format([Date of birth],"d mmm yyyy") & " in " &
[Place of Birth] & " " & Trim("and baptised this day " &
Format([Date of Baptism],"d mmm yyyy"))))

I'm not sure from your posting what format you actually want.
"dddd d mmm yyyy" will give you Saturday 6 Feb 2010
"d mmmm yyyy" 6 February 2010

Look up the format function in VBA help for further information on formatting
dates with the format command.

John Spencer
Access MVP 2002-2005, 2007-2010
The Hilltop Institute
University of Maryland Baltimore County
 

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