?
Solved

Access 2003 Query using DatePart Function

Posted on 2008-10-15
2
Medium Priority
?
452 Views
Last Modified: 2010-04-21
In a MS Access 2003 query, I am trying to extract a two-digit month from a birth date field.  

1)  When I use DatePart('m', [birth_date]) it displays the month 1- 12.  Months 1-9 are only one digit.

2)  When I use DatePart('mm', [birth_date]) it displays the error message "Invalid Procedure Call".

How do I extract a two-digit month from a birth date field in a MS Access 2003 query?
0
Comment
Question by:nulad
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 2000 total points
ID: 22725158
this will do:
right( '0' & DatePart('m', [birth_date]) , 2)

Open in new window

0
 

Author Closing Comment

by:nulad
ID: 31506484
Thank you!  Worked beautifully.  You are a Genius!
0

Featured Post

Automating Terraform w Jenkins & AWS CodeCommit

How to configure Jenkins and CodeCommit to allow users to easily create and destroy infrastructure using Terraform code.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Confronted with some SQL you don't know can be a daunting task. It can be even more daunting if that SQL carries some of the old secret codes used in the Ye Olde query syntax, such as: (+)     as used in Oracle;     *=     =*    as used in Sybase …
It is possible to export the data of a SQL Table in SSMS and generate INSERT statements. It's neatly tucked away in the generate scripts option of a database.
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question