Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Long date format 2

Status
Not open for further replies.

Aterlatus

Programmer
Jun 30, 2003
19
GB
Hi all,

I've created a report that summarises some data for last month.

I want to put a heading on this report saying "June 2003" if it's currently July 2003, "August 2003" if it's currently September 2003 etc.

So far, I've got it to print "6 / 2003" or "8 / 2003" as appropriate. How can I force access to print the long date format instead?

Thanks,

Steve Sherlock
 
To give an example

set up a new query

select any table with a populated date field

place that field in the query grid Start_date was my field

Make sure nulls are excluded otherwise you will get rubbish in blank fields.

populate the next four columns with the following

you can copy each line as is into a new column and replace start_date with the name of your date field

aa: Month([start_date])+1

bb: Year([start_date])

cc: "001/" & [aa] & "/" & [bb]

dd: Format(CVDate([cc]),"mmmm\,yyyy")

Explanation

aa gets integer value of next month

bb gets year value

cc concatenates a string into a convertable date format

dd does the conversion to date - cvdate and format displays the month in full

4 steps I know but one query and easily generated

regards

Jo
 
Add a text box in your report with a control source of:
=Format( DateAdd("m",-1,Date()), "mmmm yyyy")
You could also remove the Format() part and just set the format property of the textbox to
mmmm yyyy

Duane
MS Access MVP
 
The second option was definately the simpler solution, and it works great :D

Thanks :)
 
To add to this post, is there a way to long date format the date if you are concatenating?

For example here is what is in my control source for a textbox:

=[Forms]![frmrptRAP]![txtDueDate] & "." & " You may submit your acceptance by mail or fax to:"

Can I format the txtDueDate using mmmm dd "," yyyy ??

Thanks in advance

Sarah
 
You can use the format() function to wrap your text box reference:
=Format([Forms]![frmrptRAP]![txtDueDate],"mmmm dd ',' yyyy) & "." & " You may submit your acceptance by mail or fax to:"


Duane
MS Access MVP
 
Thank you. I kept putting the format in front of the txtDueDate.

Your awesome. Star for you.

Sarah
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top