Solved

More than 180 days before today's date

Posted on 2013-05-18
5
1,178 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

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