Home page
 
 Home 
 ASP 
 PHP 
 SQL 
 HTML 
 JavaScript 
 Search 
 Contact 
 
Search
or browse popular tags
Access Functions
Subscription

Sign up for the free email newsletter for new tips, tutorials and more. Enter your email address below, and then click the button.

Privacy Policy

RSS Twitter

Access: Year Function

Print

In Access, the Year function returns an integer between 100 and 9999, inclusive, that represents the year of a date argument.

The syntax for the Year function is:

Year ( date )

The required time argument is any numeric or string expression, that can represent a date. If number is Null, this function returns a Null.

Examples

Year (#05/05/1985#)      returns 1985
Year (#17/07/2005#)      returns 2005

VBA Code

Dim MyYear As Integer 
MyYear = Year(#04/12/1997#)

This example uses the Year function to obtain the year from a specified date. Now the MyYear  variable would contain the value of 1997.

SQL query

You can also use the Year function in a query.

SELECT Year(#14/02/2005#) AS Expr1
FROM Orders


If you'd like to see how it works, enter SQL statement and press Execute
 




Tags:

Add To: Add to dzone dzone | Digg this digg | Add to del.icio.us del.icio.us | Stumble it stumbleupon

  • Comments





Copyright © 2005-2014             www.WebCheatSheet.com All Rights Reserved.