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 » Setting Up & Running Reports
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Display prior month in a text box in an Access report?



 
 
Thread Tools Display Modes
  #1  
Old March 12th, 2007, 07:18 PM posted to microsoft.public.access.reports
Adriana
external usenet poster
 
Posts: 54
Default Display prior month in a text box in an Access report?

I have a report that will be based on different queries which I will insert
as subreports. For the month on the report, I need it to be one month prior
and current year. I read other user's questions in the community, but
nothing works. What is the date formula for something like this?
  #2  
Old March 12th, 2007, 09:21 PM posted to microsoft.public.access.reports
Adriana
external usenet poster
 
Posts: 54
Default Display prior month in a text box in an Access report?

"It" means that I will insert a text box with a date formula for one month
prior and the current year. An unbound text box, of course. Sorry for the
vague description.

"fredg" wrote:

On Mon, 12 Mar 2007 12:18:20 -0700, Adriana wrote:

I have a report that will be based on different queries which I will insert
as subreports. For the month on the report, I need it to be one month prior
and current year. I read other user's questions in the community, but
nothing works. What is the date formula for something like this?


To get the prior month and year from today's date is quite easy but
we're not mind readers.
How would any of us know what you've read or tried, so why possibly
give you the same information all over again?

Also, your post is not very clear.
Exactly what is the "it" in 'I need it to be one month prior....'?

--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail

  #3  
Old March 12th, 2007, 10:13 PM posted to microsoft.public.access.reports
fredg
external usenet poster
 
Posts: 4,386
Default Display prior month in a text box in an Access report?

On Mon, 12 Mar 2007 12:18:20 -0700, Adriana wrote:

I have a report that will be based on different queries which I will insert
as subreports. For the month on the report, I need it to be one month prior
and current year. I read other user's questions in the community, but
nothing works. What is the date formula for something like this?


To get the prior month and year from today's date is quite easy but
we're not mind readers.
How would any of us know what you've read or tried, so why possibly
give you the same information all over again?

Also, your post is not very clear.
Exactly what is the "it" in 'I need it to be one month prior....'?

--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
  #4  
Old March 13th, 2007, 01:17 AM posted to microsoft.public.access.reports
fredg
external usenet poster
 
Posts: 4,386
Default Display prior month in a text box in an Access report?

On Mon, 12 Mar 2007 14:21:00 -0700, Adriana wrote:

"It" means that I will insert a text box with a date formula for one month
prior and the current year. An unbound text box, of course. Sorry for the
vague description.

"fredg" wrote:

On Mon, 12 Mar 2007 12:18:20 -0700, Adriana wrote:

I have a report that will be based on different queries which I will insert
as subreports. For the month on the report, I need it to be one month prior
and current year. I read other user's questions in the community, but
nothing works. What is the date formula for something like this?


To get the prior month and year from today's date is quite easy but
we're not mind readers.
How would any of us know what you've read or tried, so why possibly
give you the same information all over again?

Also, your post is not very clear.
Exactly what is the "it" in 'I need it to be one month prior....'?

--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail


OK, so you have a Date field (DateTime datatype) and you wish to
display just the Month Year previous to what ever that date is?

Let's display the month as a 3 character value, i.e. Jan Feb Mar etc.

= Format(DateAdd("m",-1,[DateFieldName]),"mmm yyyy")

will display as Jan 2007 if the date value was anytime in February
2007.

Change [DateFieldName] to whatever the actual name of your date field
is.

If you want to show the month previous to the current month, then you
would use:

= Format(DateAdd("m",-1,Date()),"mmm yyyy")

will display Feb 2007 this month.

Note: the year will automatically be correct, i.e. a January 2007 date
will display as Dec 2006.

If you wish the month name in full then use:
"mmmm yyyy"

If you wish just the month as a number value, then use
"mm yyyy"

I hope this helps.

--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
  #5  
Old March 13th, 2007, 02:38 PM posted to microsoft.public.access.reports
Adriana
external usenet poster
 
Posts: 54
Default Display prior month in a text box in an Access report?

Thank you very much, this formula worked the best: =
Format(DateAdd("m",-1,Date()),"mmm yyyy")
I had something similar from a query I used, but it was too complicated and
quite longer and I kept coming up with an error. You simplified it for me, so
now I understand the order. Thanks again fredg!

"fredg" wrote:

On Mon, 12 Mar 2007 14:21:00 -0700, Adriana wrote:

"It" means that I will insert a text box with a date formula for one month
prior and the current year. An unbound text box, of course. Sorry for the
vague description.

"fredg" wrote:

On Mon, 12 Mar 2007 12:18:20 -0700, Adriana wrote:

I have a report that will be based on different queries which I will insert
as subreports. For the month on the report, I need it to be one month prior
and current year. I read other user's questions in the community, but
nothing works. What is the date formula for something like this?

To get the prior month and year from today's date is quite easy but
we're not mind readers.
How would any of us know what you've read or tried, so why possibly
give you the same information all over again?

Also, your post is not very clear.
Exactly what is the "it" in 'I need it to be one month prior....'?

--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail


OK, so you have a Date field (DateTime datatype) and you wish to
display just the Month Year previous to what ever that date is?

Let's display the month as a 3 character value, i.e. Jan Feb Mar etc.

= Format(DateAdd("m",-1,[DateFieldName]),"mmm yyyy")

will display as Jan 2007 if the date value was anytime in February
2007.

Change [DateFieldName] to whatever the actual name of your date field
is.

If you want to show the month previous to the current month, then you
would use:

= Format(DateAdd("m",-1,Date()),"mmm yyyy")

will display Feb 2007 this month.

Note: the year will automatically be correct, i.e. a January 2007 date
will display as Dec 2006.

If you wish the month name in full then use:
"mmmm yyyy"

If you wish just the month as a number value, then use
"mm yyyy"

I hope this helps.

--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail

 




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 11:58 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.