Solved

Access 2003 Query using DatePart Function

Posted on 2008-10-15
2
446 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
2 Comments
 
LVL 142

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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
query question 4 27
complicated query 15 44
Help with SQL Query 23 39
How to incorporate a join with current sql query syntax 2 18
'Between' is such a common word we rarely think about it but in SQL it has a very specific definition we should be aware of. While most database vendors will have their own unique phrases to describe it (see references at end) the concept in common …
This article describes how to use the timestamp of existing data in a database to allow Tableau to calculate the prior work day instead of relying on case statements or if statements to calculate the days of the week.
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

743 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now