Solved

Access 2003 Query using DatePart Function

Posted on 2008-10-15
2
450 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 500 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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
question about results where i dont have a match 3 42
Display field if column exists 7 56
Insert multiple records into a table 4 35
What does "Between" mean? 6 36
If you find yourself in this situation “I have used SELECT DISTINCT but I’m getting duplicates” then I'm sorry to say you are using the wrong SQL technique as it only does one thing which is: produces whole rows that are unique. If the results you a…
If you have heard of RFC822 date formats, they can be quite a challenge in SQL Server. RFC822 is an Internet standard format for email message headers, including all dates within those headers. The RFC822 protocols are available in detail at:   ht…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

738 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