MS Access 2003 Step By Step - Asim Abbasi
CH1: Overview | CH2: MS Access Local & Linked Tables | CH3: MS Access Queries | CH4: MS Access Reports & Forms | CH5: MS Access Modules & Macros | CH6: MS Access Data Import/Export Feature | CH7: MS Access Built-In Functions
Chapter 7: MS Access Built-In Functions
Example: Finding Years of Service

Let’s now look at how we will build the years of
service derived field/column. Over here we are presuming that you have
already gone through the 3 steps mentioned before this slide.
If you know the function name then there is no need to locate it in the
list. The list of functions basically provides the proper syntax of the
function. If you know already then just write it in the text area as
depicted in the slide above.
![]()
Date() function provides the current system date and
subtracting HIRE_DATE will give us the total number of days of service.
Dividing number of days of service with 365 will give you years of
service. Finally we have used the Int() function to get the integer part
of the years of service. YOS is the alias for the column. Once you run
this query you will see this column name as YOS.
Finally click the <OK> button and you will be back to your query builder
window with the derived column as YOS.
Once you are back to your query builder window the derived column will
look as shown in the slide above.
Upon execution of this query you will see only the derived column name
i.e. YOS and not the expression. This has been depicted with the label 4
in the slide.
Chapter 7: MS Access Built-In Functions
CH1: Overview | CH2: MS Access Local & Linked Tables | CH3: MS Access Queries | CH4: MS Access Reports & Forms | CH5: MS Access Modules & Macros | CH6: MS Access Data Import/Export Feature | CH7: MS Access Built-In Functions
Share with others: