Solved

How to create a query based on people who have a certain date in the next week

Posted on 2014-02-14
4
315 Views
Last Modified: 2014-02-14
I would like to create a list of people who have an expiration date in the next week.  I know that seems easy.  But if someone can help me with this one I can probably do the rest.
0
Comment
Question by:lehi52
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 22

Expert Comment

by:Flyster
ID: 39859961
You can use this in the Criteria section of your query:

=DatePart("ww",Date())+1

This will show every date that is one week more than the day the query is run.

Flyster
0
 

Author Comment

by:lehi52
ID: 39859985
I must be doing something wrong,  Its not returning any names.  I have one person that meets that criteria and they are not showing up.  Here is what I did:

The three fields it is supposed to return are policy name,   WCF POL#, and Exp Date.  I put this =DatePart("ww",Date())+1  into the criteria under exp. date.
0
 
LVL 22

Accepted Solution

by:
Flyster earned 500 total points
ID: 39860118
Sorry, my error. That's what happens when you rush. It should be:

=DatePart("ww",[YourDateField]) = DatePart("ww",Date())+1

Just change [YourDateField] to the name of your date field in the query.
0
 
LVL 22

Expert Comment

by:Flyster
ID: 39860945
Thanks for the points, but I just thought of one slight problem with the submitted solution. It will work for the first 51 weeks of the year, but not the last. Here's a better one that will work no matter what time of the year it is:

DateDiff("ww",Now(),[Day])=1

So when it gets to the end of December, it will still know that January is just 1 week away!
0

Featured Post

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
If you need a simple but flexible process for maintaining an audit trail of who created, edited, or deleted data from a table, or multiple tables, and you can do all of your work from within a form, this simple Audit Log will work for you.
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

696 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question