filter by current month name

C

ChuckW

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,
 
K

KARL DEWEY

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

John W. Vinson

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.
 
C

ChuckW

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,
 
J

John W. Vinson

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top