• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 463
  • Last Modified:

Access 2003 Query using DatePart Function

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
nulad
Asked:
nulad
1 Solution
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
this will do:
right( '0' & DatePart('m', [birth_date]) , 2)

Open in new window

0
 
nuladAuthor Commented:
Thank you!  Worked beautifully.  You are a Genius!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now