1. Home
  2. Computing & Technology
  3. Databases

Microsoft Access Function Library: DatePart()

By Mike Chapple, About.com

Function: DatePart()

Purpose: The DatePart() function returns the requested piece of a date.

Usage: DatePart(interval, date)

Interval may be set to:
  • yyyy for year
  • q for quarter
  • m for month
  • y for day of year
  • d for day
  • w for weekday
  • ww for week
  • h for hour
  • n for minute
  • s for second


Returns: Interval part of date.

Examples and Special Cases
DatePart("yyyy", "6-Nov-2006") returns 2006
DatePart("m", "31-Dec-2006") returns 12
DatePart("d", "6-Nov-2006") returns vbMonday (2)
Explore Databases
About.com Special Features

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

Easy ways to connect two computers for networking purposes. More >

  1. Home
  2. Computing & Technology
  3. Databases
  4. Microsoft Access
  5. Access Function Library
  6. Microsoft Access Function Library: DatePart()>

©2009 About.com, a part of The New York Times Company.

All rights reserved.