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

filter by current month name



 
 
Thread Tools Display Modes
  #1  
Old October 27th, 2008, 03:46 PM posted to microsoft.public.access.queries
ChuckW
external usenet poster
 
Posts: 182
Default filter by current month name

Hi,

I have a table with transactions that has a field called FiscalMonth that
has the name of a month in it (i.e. October). I want to run a query that
will always give transactions for the current fiscal month on a rolling
basis. Can someone help?

Thanks,
--
Chuck W
  #2  
Old October 27th, 2008, 04:36 PM posted to microsoft.public.access.queries
KARL DEWEY
external usenet poster
 
Posts: 10,767
Default filter by current month name

Use this as criteria --
Format(Date(), "mmmm")
Of course you know this method will mix 2007 and 2008 data of the same month.
--
KARL DEWEY
Build a little - Test a little


"ChuckW" wrote:

Hi,

I have a table with transactions that has a field called FiscalMonth that
has the name of a month in it (i.e. October). I want to run a query that
will always give transactions for the current fiscal month on a rolling
basis. Can someone help?

Thanks,
--
Chuck W

  #3  
Old October 27th, 2008, 05:11 PM posted to microsoft.public.access.queries
John W. Vinson
external usenet poster
 
Posts: 18,261
Default filter by current month name

On Mon, 27 Oct 2008 08:46:15 -0700, ChuckW wrote:

Hi,

I have a table with transactions that has a field called FiscalMonth that
has the name of a month in it (i.e. October). I want to run a query that
will always give transactions for the current fiscal month on a rolling
basis. Can someone help?

Thanks,


One quick question: how is your fiscal month defined? Format(Date(), "mmmm")
will give the current calendar month name, but if your fiscal November starts
on October 29 you'll get the wrong data.
--

John W. Vinson [MVP]
  #4  
Old October 27th, 2008, 08:21 PM posted to microsoft.public.access.queries
ChuckW
external usenet poster
 
Posts: 182
Default filter by current month name

John,

I don't have a field that has a date value in my table. I only have a field
called fiscal month and it is a text value (January, February, March etc.).
The table only has 2008 transactions and next year, a new table will be
created. So I want to run a query that will return transactions where the
FiscalMonth field is equal to October. When fiscal November starts, the
query needs to pull only records that have November in this field.

Thanks,
--
Chuck W


"John W. Vinson" wrote:

On Mon, 27 Oct 2008 08:46:15 -0700, ChuckW wrote:

Hi,

I have a table with transactions that has a field called FiscalMonth that
has the name of a month in it (i.e. October). I want to run a query that
will always give transactions for the current fiscal month on a rolling
basis. Can someone help?

Thanks,


One quick question: how is your fiscal month defined? Format(Date(), "mmmm")
will give the current calendar month name, but if your fiscal November starts
on October 29 you'll get the wrong data.
--

John W. Vinson [MVP]

  #5  
Old October 27th, 2008, 08:36 PM posted to microsoft.public.access.queries
John W. Vinson
external usenet poster
 
Posts: 18,261
Default filter by current month name

On Mon, 27 Oct 2008 13:21:01 -0700, ChuckW wrote:

John,

I don't have a field that has a date value in my table. I only have a field
called fiscal month and it is a text value (January, February, March etc.).
The table only has 2008 transactions and next year, a new table will be
created. So I want to run a query that will return transactions where the
FiscalMonth field is equal to October. When fiscal November starts, the
query needs to pull only records that have November in this field.

Thanks,


My suggestion has nothing to do with a date field in the table.

A criterion on the field of

=Format(Date(), "mmmm")

will look at the computer clock, determine today's date, and format it as the
name of a month. That is, if you use this as a criterion in a query run today,
it will find all records where the FiscalMonth is equal to "October"; if you
run it this coming Wednesday, it will find "November".

If you want the computer to automatically determine the name of the current
fiscal month, as of today, you will have to tell us how you calculate the
fiscal month. You haven't said, and nobody here can possibly know.
--

John W. Vinson [MVP]
 




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


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