Topics Search

Month To Date Comparison Query This Month To Last Month

Month To Date Comparison Query This Month To Last Month
Views: 2
First post)

I have a table that captures sales data by day, and I include some data to identify the day of the month. I'm trying to do a query that allows me to get the totals for this month so far, and compare it to the same point last month. This is a sample of the table.
Table.png ( 15.7K ) Number of downloads: 28

What kind of query parameter or multiple queries do I need to do to say Sum of April versus Sum of March but only through the 4th day of the month (DOM Column).

So in this case the answer would be April MTD has 7 Sold New and 5 Sold Used compared to March had at the same point 15 Sold New and 10 Sold Used
Sponsored Links:

More topics

 

Refer to ONLY THE MONTH??

Preview
im having trouble writing a query. how do I select ONLY the ones that are ONLY within the month of the request date, and if there is a request date that is NEXT MONTH or MORE, then ignore it? thanks

also, ive been told to use Month (#date value #) the only problem with this is, I want this query to be self sustaining so that no one will have to constantly change the date value every month, similar to Date(). Date() always refers to the CURRENT month and day
 

Refer to ONLY THE MONTH??

Preview
How do I select ONLY the ones that are ONLY within the month of the request date, and if there is a request date that is NEXT MONTH or MORE, then ignore it?

also, I've been told to use Month (#date value #) the only problem with this is, I want this query to be self sustaining so that no one will have to constantly change the date value every month, similar to Date(). Date() always refers to the CURRENT month and day
 

How do I convert an inout month number into a month name?

Preview
I have a report based on a query where in the query the user inputs a month from 1 - 12. How do I make the report say the name of the month instead of the inputted number?

The field in the query is constructed like this:

Field Month: Month([tbl_2_CustomerOrder.OrderDate])

Criteria [Input month (1-12)]

I've tried using =Format$([Month],"mmmm") but it always returns "January
 

Using Current Date to find 16th

Preview
I have a few queries that use date parameters. We use a 15th date as month end.
Example Month - 05/16/2011 - 06/15/2011 (I usually just do a less than 06/16/2011 to make it easy).

I have created these to figure out the 16th of the current month and the 16th of previous month:
MONTH BEGIN: DateSerial(Year(Date()),Month(Date())-1,1)+15
MONTH END: DateSerial(Year(Date()),Month(Date()),1)+15

This will work great assuming the query runs between 06/16/2011 and 06/31/2011.

MY QUESTION:
Is there a way to create an IF statement and between the 16th of current month and 15th of next month, find the correct dates.

FOR EXAMPLE -
IF RUN TODAY I WANT - 05/16/2011 and 06/16/2011
IF I RUN TOMORROW I WANT - 05/16/2011 and 06/16/2011
IF I RUN 07/10/2011 I WANT - 05/16/2011 and 06/16/2011
BUT.IF I RUN 07/16/2011 I WANT - 06/16/2011 and
 

Records for next month

Preview
Looking to create a report criteria that would display all records with a due date for the next month. I know I can get the current month with Month(Now()) what is the syntax for the following month?
 

Query for finding Min & Max of a Month

Preview
I have to create a select query (which I think is a bit complex). I have to retrieve Week, Year and month from a Master table. I find this simple. Apart from this I need to find the starting date of a particular month and last date of the particular month for the respective month. The problem is the month is not a calender month and dates differ. It will be easy to understand if you have look at the table(attached Zipped Image file).

The columns "Week", "Year" & "Month" are directly selected from the master table. The Column "Beg Week Month" & "End Week Month" have to be created in the query. I am able to find Min of "Beg Week Month" & Max of "End Week Month", but I need for that particular month as displayed in the table
 

Month and Year Criteria

Preview
I am setting up a form and I would like the date for the next 12 months to be updated automatically. I would like it to read the month and year for each month. What is the code in achieving this?

September - Current month and year
October - Current month and year +1
November - Current month and year +2
December - Current month and year +3

You get the picture =) I appreciate your help with this!
 

MonthName instead of month number

Preview
I have built a query that supplies me some totals by month. The query works awesome except that I don't want numbers for the month.

How do I get the numbers representing the month to reflect the alpha for that month?

Here is my SQL:
 

Custom Date in Query

Preview
I have a query I am merging with Publisher and need a specific date every month. In this date, I need the day of the month to be the 9th; the current month for the current year.

Example;

We are in sept so need the date field to be September 9, 2011. Next month when I run the report, the query will populate this column with October 9, 2011, and so on.

Is there a date function I can format for this field
 

Custom Date in Query

Preview
I have a query I am merging with Publisher and need a specific date every month. In this date, I need the day of the month to be the 9th; the current month for the current year.

Example;

We are in sept so need the date field to be September 9, 2011. Next month when I run the report, the query will populate this column with October 9, 2011, and so on.

Is there a date function I can format for this field?