Parameters

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have two queries that both use paramters to get their results. The first one is a MTD query it prompts the user for a starting and ending date for the month. The YTD is set up to have a starting date 11/01/2003 which is the begging of our year and the ending date which is entered in the mTD parameter. What I want to do is to design this so I user enters the starting and ending range for the month but I want the YTD range to always be as of the end of the previous month unless the date range for MTD encompesses a whole month. US their a way to accomplish this.
 
I have two queries that both use paramters to get their results. The first one is a MTD query it prompts the user for a starting and ending date for the month. The YTD is set up to have a starting date 11/01/2003 which is the begging of our year and the ending date which is entered in the mTD parameter. What I want to do is to design this so I user enters the starting and ending range for the month but I want the YTD range to always be as of the end of the previous month unless the date range for MTD encompesses a whole month. US their a way to accomplish this.

You can get the end of the current month using the expression

DateSerial(Year(Date()), Month(Date()) + 1, 0)

This is "the zeroth day of next month", which DateSerial is clever
enough to interpret as the last day of this month.
 
Back
Top