Solved

More than 180 days before today's date

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

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

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

The first two articles in this short series — Using a Criteria Form to Filter Records (http://www.experts-exchange.com/A_6069.html) and Building a Custom Filter (http://www.experts-exchange.com/A_6070.html) — discuss in some detail how a form can be…
QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
Familiarize people with the process of utilizing SQL Server functions 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 Microsoft Ac…
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.

786 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