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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
Calculate Year from Current Year
|
#5
|
|||
|
|||
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 | |
|
|