?
Solved

More than 180 days before today's date

Posted on 2013-05-18
5
Medium Priority
?
1,339 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 1200 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Traditionally, the method to display pictures in Access forms and reports is to first download them from URLs to a folder, record the path in a table and then let the form or report pull the pictures from that folder. But why not let Windows retr…
Code that checks the QuickBooks schema table for non-updateable fields and then disables those controls on a form so users don't try to update them.
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Suggested Courses

840 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