By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,466 Members | 2,140 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,466 IT Pros & Developers. It's quick & easy.

Convert to mm/dd/yyyy

P: 41
Does anyone know how to convert a string to mm/dd/yyyy format? I want the result to show "09/07/2007" and not "9/7/2007". It should recognise that the user might enter a date as 9/7/2007 but must change it to 09/07/2007
Sep 10 '07 #1
Share this Question
Share on Google+
4 Replies


Scott Price
Expert 100+
P: 1,384
Does anyone know how to convert a string to mm/dd/yyyy format? I want the result to show "09/07/2007" and not "9/7/2007". It should recognise that the user might enter a date as 9/7/2007 but must change it to 09/07/2007
You might be looking for something like this:
Expand|Select|Wrap|Line Numbers
  1. Format(#9/7/2007#, "mm/dd/yyyy")
Regards,
Scott
Sep 10 '07 #2

P: 41
Thanks, Scott! It works now. :-)
Sep 10 '07 #3

Jim Doherty
Expert 100+
P: 897
You might be looking for something like this:
Expand|Select|Wrap|Line Numbers
  1. Format(#9/7/2007#, "mm/dd/yyyy")
Regards,
Scott
In addition if you put this....00/00/0000
as an input mask into your form date fields then it will force leading zeros and only numbers to make up the mm/dd/yyyy giving you the slash marks in place already
Sep 10 '07 #4

Scott Price
Expert 100+
P: 1,384
You're welcome, Cloh, and take a good look at Jim's suggestion as well. Changing a date after it's entered is never as good an option as making sure it's entered correctly in the first place :-)

Regards,
Scott
Sep 10 '07 #5

Post your reply

Sign in to post your reply or Sign up for a free account.