Format Date

  • Thread starter Thread starter Roger Bell
  • Start date Start 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.
 
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
 
Back
Top