A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Calculate Year from Current Year



 
 
Thread Tools Display Modes
  #1  
Old July 10th, 2008, 08:26 PM posted to microsoft.public.access.queries
MB
external usenet poster
 
Posts: 211
Default Calculate Year from Current Year

I have a table that has a field called YearInstalled. Data type is Number
(long integer) with validation rule: Is Null Or Between 1000 And 2999. (I
only need the year.)

Need to calculate the YearInstalled from the current year. I was doing this
in the query by adding a field but could not figure out the right syntax.

What is the correct way to do this calculation?
--
MB
  #2  
Old July 10th, 2008, 08:37 PM posted to microsoft.public.access.queries
John Spencer
external usenet poster
 
Posts: 7,815
Default Calculate Year from Current Year

Year(Date()) will return the current year.

If that is not what you want, perhaps you can tell us what you do want in some
other words.

John Spencer
Access MVP 2002-2005, 2007-2008
The Hilltop Institute
University of Maryland Baltimore County

MB wrote:
I have a table that has a field called YearInstalled. Data type is Number
(long integer) with validation rule: Is Null Or Between 1000 And 2999. (I
only need the year.)

Need to calculate the YearInstalled from the current year. I was doing this
in the query by adding a field but could not figure out the right syntax.

What is the correct way to do this calculation?

  #3  
Old July 10th, 2008, 08:48 PM posted to microsoft.public.access.queries
MB
external usenet poster
 
Posts: 211
Default Calculate Year from Current Year

Thanks for the quick response, John. I would like the result to be the
number of years between the current Year and the year installed. (field name
YearInstalled) Do I use a query? If so, what is the correct expression?

Thank you again.
--
MB


"John Spencer" wrote:

Year(Date()) will return the current year.

If that is not what you want, perhaps you can tell us what you do want in some
other words.

John Spencer
Access MVP 2002-2005, 2007-2008
The Hilltop Institute
University of Maryland Baltimore County

MB wrote:
I have a table that has a field called YearInstalled. Data type is Number
(long integer) with validation rule: Is Null Or Between 1000 And 2999. (I
only need the year.)

Need to calculate the YearInstalled from the current year. I was doing this
in the query by adding a field but could not figure out the right syntax.

What is the correct way to do this calculation?


  #4  
Old July 10th, 2008, 09:14 PM posted to microsoft.public.access.queries
[email protected]
external usenet poster
 
Posts: 51
Default Calculate Year from Current Year

Try Year(Date()) - YearInstalled in a query column

Peter De Baets
http://www.peterssoftware.com
  #5  
Old July 10th, 2008, 09:24 PM posted to microsoft.public.access.queries
MB
external usenet poster
 
Posts: 211
Default Calculate Year from Current Year

THANK YOU!!
--
MB


" wrote:

Try Year(Date()) - YearInstalled in a query column

Peter De Baets
http://www.peterssoftware.com

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 05:54 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.