Solved

More than 180 days before today's date

Posted on 2013-05-18
5
1,204 Views
Last Modified: 2013-05-18
ccess 2010
I have an update query where I want to find anyone whose MemberStatus is 1 AND who enquired more than 180 days before today, then update their status to 4.  The date field -DateEnquired - is set to Short Date. The Criteria is <Date()-180.  This returns an error message.
What am I missing?
UPDATE-BASED-ON-DATE.JPG
0
Comment
Question by:msmerry
[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
  • 2
5 Comments
 
LVL 22

Expert Comment

by:Kelvin Sparks
ID: 39178145
Use the DATEADD function
<DATEADD("d", -180,DATE())

Kelvin
0
 

Author Comment

by:msmerry
ID: 39178156
Thanks Kelvin,
Tried that but it doesn't work.  
I would guess that it is looking for a specific date - exactly 180 days before today - in other words,  take 180 days off today; if there is no such entry, then it returns nothing.

What I want is Find all dates greater than 180 days before today - somewhere it requires <. or is it >?
Aileen
0
 
LVL 22

Expert Comment

by:Kelvin Sparks
ID: 39178157
Do you mean within the last 180 days or more than 180 days ago?

Kelvin
0
 
LVL 22

Accepted Solution

by:
Kelvin Sparks earned 300 total points
ID: 39178158
Reading your initial post again it should be

DateEnquired < DATEADD("d",-180,Date()) AND MemberStatus = 1.

Try using it in a select statement until you get the query correct, then use it to make the update statement.


Kelvin
0
 

Author Closing Comment

by:msmerry
ID: 39178163
MAny thanks - always beneficial to come to EE
0

Featured Post

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

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

You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

728 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