Solved

More than 180 days before today's date

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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Join & Write a Comment

Suggested Solutions

Regardless of which version on MS Access you are using, one of the harder data-entry forms to create is one where most data from previous entries needs to be appended to new records, especially when there are numerous fields and records involved.  W…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…

746 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now