473,385 Members | 1,337 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

How do I convert date yyddmm to mmddyyyy

Can anyone help me... I need to convert a date field that is in format yyddmm to format mmddyyyy. Thanks.
May 4 '11 #1

✓ answered by colintis

I guess the data type in that table field is in text, as Conerlysduck said the data is imported from file.

If that's the case, it will be a bit complicate to convert the date formats. First from string to date, change date format, and convert it back to string. Here's a concept of update query might help
Expand|Select|Wrap|Line Numbers
  1. UPDATE [Table name] 
  2. SET [date field name] = CStr(Format(Format(CDate([date field name]), "20yyddmm"), "mmddyyyy"))
Not sure if it fully works this way, you need to try it out with something similar as well.

7 3893
TheSmileyCoder
2,322 Expert Mod 2GB
In the format property of the table OR the query used for your form/Report OR the control used to display your field you can set how you want it formatted. Simply write mmddyyyy in the format field.
May 5 '11 #2
Thank you for your response. I tried that but it does not change the format in my table. The date in the table shows 113010, I need it to show 10302011. The format needs to be reversed and the year needs to show 2011. Any suggestions?
May 5 '11 #3
Rabbit
12,516 Expert Mod 8TB
Are you sure it's a date data type? Because dates don't show as yyddmm unless there's already a format on there. I suspect it's actually a string data type and you have to convert it to a date first. Just because it looks like a date doesn't mean it's a date data type.
May 5 '11 #4
Yes, I'm sure it's a date. It's an invoice date in format yyddmm. I imported a file into Access and now I need to change the date format to mmddyyyy. Maybe using DateSerial, but I don't know how to tell it what I want. Can you help?
May 5 '11 #5
Rabbit
12,516 Expert Mod 8TB
Then all you have to do is go into the property where it says yyddmm and change it to say mmddyyyy. Someone had to put yyddmm in there for it to show up like that. If no one did, then it most likely means the data type is not a date. To be sure, go into the table design and look at what it says in Data Type.
May 5 '11 #6
colintis
255 100+
I guess the data type in that table field is in text, as Conerlysduck said the data is imported from file.

If that's the case, it will be a bit complicate to convert the date formats. First from string to date, change date format, and convert it back to string. Here's a concept of update query might help
Expand|Select|Wrap|Line Numbers
  1. UPDATE [Table name] 
  2. SET [date field name] = CStr(Format(Format(CDate([date field name]), "20yyddmm"), "mmddyyyy"))
Not sure if it fully works this way, you need to try it out with something similar as well.
May 6 '11 #7
Thank you for all your help. I got it to work using this:

Right([NBC Cancellation File]![INVOICE RECEIPT DT],2) & Mid([NBC Cancellation File]![INVOICE RECEIPT DT],3,2) & "20" & Left([NBC Cancellation File]![INVOICE RECEIPT DT],2)
May 6 '11 #8

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

Similar topics

1
by: mscgloss | last post by:
Hello All, I can't seem to find an answer to this anywhere else: I need to convert a datestamp to the following format: MMDDYYYY. I've found solutions to convert it to many different kids of...
0
by: sumeet | last post by:
how do i convert a yyyymmdd format to yyyy,mm,dd format. also i want to know how do i get the number of days between two dates which r in the format yyyymmdd. how to convert date into unix time...
3
by: galsaba | last post by:
What would be the function to convert date to the number of date for example, 2/14/05 is 45, becuse this is the 45th day of the year. What would be the function? Where can I find info on the web...
3
by: sparkle | last post by:
Hi, Does anybody know how to convert date to ticks from a dateTimePicker? What I'm using now isn't working. I'm trying to use a dateTimePicker to set an appointment in Outlook with a...
1
by: prabhunew2005 | last post by:
I am using postgres,php in web designing. I have to convert date entered in MM-DD-YYYY format to YYYY-MM-DD format. I have to use resulting date format in my search sql. I used todate method. But i...
5
by: Totto | last post by:
Hi, Is it possible to convert date to dd mon yyyy hh:mi(24h) Thanks Totto
1
by: Fibre Optic | last post by:
Hello, I am looking for way to convert date i.e. "Fri Feb 23 06:13:55 EST 2007" to unix time stamp? Does any one know a library which could be help full? Regards, Fibre Optic
1
by: nitinkeser | last post by:
how i convert date into specific format in asp? like in date format 'Jun 17, 2007' ?
3
by: veaux | last post by:
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...
17
KalariaNitya
by: KalariaNitya | last post by:
Hello All, I want to convert Date to Hindu Calender. For e.g. today is 12th sep'2008 so convert it to bhadarvo sud baras. can anybody help me how to do that? thanking u in advanced..
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.