Solved

Queries using the end of current year date

Posted on 2011-09-11
4
198 Views
Last Modified: 2012-05-12
In November of each year I need to be able to update the age of each member as of 12/31/XXXX, whatever the current year. How do I write the update queries EofY Age and EofY LOM without having to change the date in the queries each year? Thank you.
0
Comment
Question by:lheroux
[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
4 Comments
 
LVL 93

Expert Comment

by:Patrick Matthews
ID: 36520640
To get the end of the current year:

Dateserial(year(now()),12,31)
0
 
LVL 18

Accepted Solution

by:
lludden earned 500 total points
ID: 36520643
Age at end of current year is:

UPDATE mytable SET Age =  int(DateDiff("m",Birthdate,DateSerial(Year(Now()),12,31))/12)
0
 
LVL 70

Expert Comment

by:Qlemo
ID: 37218503
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0

Featured Post

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

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

User Beware!  This is a rather permanent solution to removing your email from an exchange server.  The only way to truly go back is to have your exchange administrator restore your mailbox from backups.  This is usually the option of last resort.  A…
Composite queries are used to retrieve the results from joining multiple queries after applying any filters. UNION, INTERSECT, MINUS, and UNION ALL are some of the operators used to get certain desired results.​
Viewers will learn the different options available in the Backstage view in Excel 2013.
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …
Suggested Courses

636 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