Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
|
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 5th, 2007, 03:30 PM
Authorized User
 
Join Date: Mar 2007
Posts: 54
Thanks: 0
Thanked 0 Times in 0 Posts
Default Converting short date to show mm/dd/yyyy

Ive got a field set to shortdate and when you enter a date, it appears as 6/5/2007. How do I change this to show 06/05/2007? I can't figure out how this is done, but it's gotta be something stupid simple.

Thanks!

 
Old March 5th, 2007, 03:57 PM
Authorized User
 
Join Date: Mar 2007
Posts: 54
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Forget it guys, I figured it out. I just changed the format field from shortdate to mm/dd/yyyy.



 
Old March 5th, 2007, 04:03 PM
Authorized User
 
Join Date: Mar 2007
Posts: 54
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Ok, I'm back again... Now I'm trying to convert the date 06/05/2007 to a string, but when I do, I lose the leading zero again. Can anyone give me the correct syntext? str([DATE]) just doesn't work. :(



 
Old March 6th, 2007, 09:02 AM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

Are you losing the leading zero in the month and the day? Or just the month?

mmcdonal
 
Old March 7th, 2007, 03:46 AM
Registered User
 
Join Date: Oct 2006
Posts: 41
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Have you tried using FORMAT.

For example

DIM strDate as String

strDate = Date

FORMAT(srtrDate,"mm/dd/yyyy")

This should provide you with all leading zero's





Similar Threads
Thread Thread Starter Forum Replies Last Post
How to pull Month & Year from Date(dd/mm/yyyy) istcomnet Classic ASP Basics 2 April 22nd, 2008 06:22 PM
Date dd-mm-yyyy John2112 SQL Server 2000 2 March 16th, 2007 05:15 AM
convert "MM/dd/yyyy" to "dd/MM/yyyy" xin56 General .NET 4 March 28th, 2005 05:33 AM
Date formats... dd/mm/yyyy SeanW Classic ASP Databases 3 June 14th, 2004 12:34 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.