By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,493 Members | 1,179 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,493 IT Pros & Developers. It's quick & easy.

Report for Current Month.

P: n/a
Hey all,

I did some searching and can't seem to find what Im looking to do.

I have a time sheet DB and would like to make a report to show all of
the records for the current month.

I've played with some queries but can't seem to get it to work. Any
ideas?

Thanks for all of your help!

Jan 2 '07 #1
Share this Question
Share on Google+
5 Replies


P: n/a
As long as the date in the DB is defined as a date then

In a select query (to start with) as criteria put:

Year(date()) = year(Timesheetdatefieldname) and month(date()) =
month(timesheetdatefieldname)

Ron

Jan 2 '07 #2

P: n/a
Since im still a wee newb, where do I put these lines?

Thanks Ron!

Ron2006 wrote:
As long as the date in the DB is defined as a date then

In a select query (to start with) as criteria put:

Year(date()) = year(Timesheetdatefieldname) and month(date()) =
month(timesheetdatefieldname)

Ron
Jan 2 '07 #3

P: n/a
Open the base query for you report in design mode and put the line of
code in the criteria line under the "Timesheetdatefieldname". Use the
build option (right click on the criteria line) and create the criteria
in the window it shows. This is so you can see how it ends up modifying
the field name.

After you close the query and open it again in design mode you will see
that Access has added two columns to your query with the criteria for
each spelled out. Once you see how it does it you could use the same
technique (of splitting the tests) in other queries.

Ron

Jan 2 '07 #4

P: n/a
Ron,

I did all that and got the same results when I went back into the
design view. When I double click the query to run it, I get a Data type
mismatch error. Any Ideas?

Ron2006 wrote:
Open the base query for you report in design mode and put the line of
code in the criteria line under the "Timesheetdatefieldname". Use the
build option (right click on the criteria line) and create the criteria
in the window it shows. This is so you can see how it ends up modifying
the field name.

After you close the query and open it again in design mode you will see
that Access has added two columns to your query with the criteria for
each spelled out. Once you see how it does it you could use the same
technique (of splitting the tests) in other queries.

Ron
Jan 2 '07 #5

P: n/a
"radink" <ra*****@gmail.comwrote in message
news:11**********************@s34g2000cwa.googlegr oups.com...
Hey all,

I did some searching and can't seem to find what Im looking to do.

I have a time sheet DB and would like to make a report to show all of
the records for the current month.

I've played with some queries but can't seem to get it to work. Any
ideas?
It is best not to apply criteria to an expression unless that is the only way to
do it.

Post the SQL of your current query or at least the name of the date field you
are trying to filter on.
--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com
Jan 2 '07 #6

This discussion thread is closed

Replies have been disabled for this discussion.