A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » New Users
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Format Date



 
 
Thread Tools Display Modes
  #1  
Old February 6th, 2010, 07:30 AM posted to microsoft.public.access.gettingstarted
Roger Bell
external usenet poster
 
Posts: 275
Default Format Date

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.
  #2  
Old February 6th, 2010, 01:59 PM posted to microsoft.public.access.gettingstarted
John Spencer
external usenet poster
 
Posts: 7,815
Default Format Date

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

Roger Bell wrote:
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.

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 10:22 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.