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

Date Format MMDDYYYY

P: n/a
The date format mmddyyyy is common but I realize it's not a standard
format in Access. There must be a simple way to provide this format
to Access so it treats it as a date? In past, I play with it and do a
(Left MM, Mid, and Right Function) and add "/" so it's recognized.
There has to be a better way than this?? What I'd want to do is be
able to import the data directly into a date field, vs import into a
text and then transfer to a date field.
Nov 19 '07 #1
Share this Question
Share on Google+
3 Replies


P: n/a

Sub DateStuff()
Dim d1 As Date
d1 = #11/19/2007#
Debug.Print d1 '--this prints 11/19/2007
Debug.Print Format(d1, "mmddyyyy")
'-- this prints 11192007
End Sub
Rich

*** Sent via Developersdex http://www.developersdex.com ***
Nov 19 '07 #2

P: n/a
On Mon, 19 Nov 2007 11:02:23 -0800 (PST), ve***@aol.com wrote:
The date format mmddyyyy is common but I realize it's not a standard
format in Access. There must be a simple way to provide this format
to Access so it treats it as a date? In past, I play with it and do a
(Left MM, Mid, and Right Function) and add "/" so it's recognized.
There has to be a better way than this?? What I'd want to do is be
able to import the data directly into a date field, vs import into a
text and then transfer to a date field.
If the field is a Date Datatype, simply set the Format property of the
control on your form to:
mmddyyyy
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
Nov 19 '07 #3

P: n/a
On Nov 19, 4:35 pm, fredg <fgutk...@example.invalidwrote:
On Mon, 19 Nov 2007 11:02:23 -0800 (PST), ve...@aol.com wrote:
The date format mmddyyyy is common but I realize it's not a standard
format in Access. There must be a simple way to provide this format
to Access so it treats it as a date? In past, I play with it and do a
(Left MM, Mid, and Right Function) and add "/" so it's recognized.
There has to be a better way than this?? What I'd want to do is be
able to import the data directly into a date field, vs import into a
text and then transfer to a date field.

If the field is a Date Datatype, simply set the Format property of the
control on your form to:
mmddyyyy
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
Thanks for suggestions above, but I'm actually referring to importing
the data into a table vs using it in a form. I'm importing a csv
table in which that field is text 8 char. Importing it into an Access
Date field formatted as mmddyyyy does not seem to work. I don't want
to import into a text field, as I am now, because then I cannot
calculate off of the date.
Nov 26 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.