YTD

S

Shilpa

A couple of weeks ago I made a post asking for a query
that returns records of the current year (up to the
previous month). The criteria suggested is as follows:
=DateSerial(Year(Date()),1,1) And <DateSerial(Year(Date
()),Month(Date()),1)

The query works, except when the current month is
January. Any suggestions?
 
R

Rick Brandt

Shilpa said:
A couple of weeks ago I made a post asking for a query
that returns records of the current year (up to the
previous month). The criteria suggested is as follows:

()),Month(Date()),1)

The query works, except when the current month is
January. Any suggestions?

Given that your criteria is YTD "up to the previous month" what exactly do you want
it to do when run in January?
 
J

John Vinson

A couple of weeks ago I made a post asking for a query
that returns records of the current year (up to the
previous month). The criteria suggested is as follows:

()),Month(Date()),1)

The query works, except when the current month is
January. Any suggestions?

The current year up to the previous month, in January, is an empty
set.

Do you mean the *previous* year's complete data? or the data from
January 1 through today (which is of course discrepant with all the
other months)?
 

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