Creating a Period Date Range

L

Legacy 15162

Guest
I am creating a database for my company and we run off an abnormal period. We have 13 periods for the year. Our weeks run from Tues-Monday. I am trying to put together a DB that shows our weekly sales by period. Currently, as of 2/11/04, we are on Period 2 Week 4. The data comes in everynight and we report based on yesterday's data. How can I get the queries to show only that data for the current period without having to enter a date range everytime?
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
One way might be to create a table with three fields. First field would be the period number (fldPeriod), the second field would be the starting date of the period (fldStartDate), and the third field would be the ending date of the period (fldEndDate).

Add the table to your query, but don't make any relationships between the two.

Bring in the fldPeriod field from your new table in to the query and for Criteria enter:
=[Enter Period]

To pull in the correct dates, you would just enter this criteria in the date field of your daily report table:
Between [fldStartDate] and [fldEndDate]

This should work, but I haven't tested it. When you run the query it will prompt you to enter the Period and it should pull the correct dates.
 
Upvote 0

Forum statistics

Threads
1,221,621
Messages
6,160,879
Members
451,675
Latest member
Parlapalli

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top