Using MS Access/This/Next Week Formula

Advertisement


Question
You previously gave me this answer for a next week query.
ANSWER: For Next Week try this. Add a column to your query:

WK: DatePart("ww",[datefield])

For the criteria in that column use:

Datepart("ww",Date())+1

It has worked but now that we are in a new year, it's not only picking this year's info, it has last years information in the report as well.  Do I need to add something to the formula so it'll only pull the current years information?  Thanks!!

Answer
This depends on what you consider the starting week. Please review the Datepart function in Access help. In some cases Week 1 may include dates from the previous year. If you want to filter those out, you may have to adjust the starting point of the year, or include additional criteria to pull only the current year.

Hope this helps,
Scott<>
Blog: http://scottgem.wordpress.com
Website: http://www.diamondassoc.com
Microsoft Access MVP 2007
Author: Microsoft Office Access 2007 VBA

Using MS Access

All Answers


Answers by Expert:


Ask Experts

Volunteer


Scottgem

Expertise

I can answer almost all types of questions relating to Microsoft Access usage and application design. My strengths are database and interface design.

Experience

I've been designing databases for over 25 years working with dBase, FoxPro, Approach and Access.

Organizations
Author of Microsoft Office Access 2007 VBA
Techncial Editor for Special Edition Using Microsoft Access 2007 and Access 2007 Forms, Reports & Queries From Que Publishing

Education/Credentials
Brooklyn College BA

©2016 About.com. All rights reserved.