Calculate Year from Current Year

Calculate Year from Current Year

Post by TUI » Sat, 12 Jul 2008 04:26:05


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
 
 
 

Calculate Year from Current Year

Post by John Spenc » Sat, 12 Jul 2008 04:37:04

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

 
 
 

Calculate Year from Current Year

Post by TUI » Sat, 12 Jul 2008 04:48:01

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
 
 
 

Calculate Year from Current Year

Post by pddxx » Sat, 12 Jul 2008 05:14:02

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

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

Calculate Year from Current Year

Post by TUI » Sat, 12 Jul 2008 05:24:01

THANK YOU!!
--
MB