473,385 Members | 1,356 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.

Date format in Access or even Excel

I need to convert dates like this "82009" (20th Aug 09) into a proper date format. Any tips would be appreciated. Thanks
Jul 14 '10 #1
9 1462
NeoPa
32,556 Expert Mod 16PB
Melissa,

looking at your string it seems clear that there is no easy way to determine what is intended. The relevance of the second column can only be by reading the data first. Consider dates :
Expand|Select|Wrap|Line Numbers
  1. 20 Aug 2009   82009
  2. 3 Nov 2009    11309 (or is that 13 Jan 2009)
  3. 10 Dec 2009   121009
  4. 9 Jan 2009    1909
Can you see why this method of displaying dates is entirely inadequate. Line #2 particularly, shows why it's sometimes impossible to determine the date correctly when presented with it in this format. This is why the "/" character is often used. There are other viable ways of storing/displaying date data, but this isn't one of them.

Welcome to Bytes!
Jul 14 '10 #2
Thanks NeoPa,

I see your point. I managed to sort it out. I know it's in US format, therefore I separated the 5 digits and 6 digits and used to following script accordingly, making slight chages, in Excel.
Expand|Select|Wrap|Line Numbers
  1. =(MID(A2,2,2)&"/"&LEFT(A2,1)&"/"&RIGHT(A2,2))
Jul 14 '10 #3
NeoPa
32,556 Expert Mod 16PB
It doesn't seem that would work reliably for all the data I posted Melissa.

Is the format you're dealing with one you're stuck with?

Does whoever decided to formulate the data that way realise the problems they've caused?
Jul 14 '10 #4
Hi, well the date is in the US format so I went with it this way, using the code and amending it when there's 6 or 5 digits. And it's just a one off for now, but I have asked for the data to be re-sent so I can do a comparison, just to make sure that it worked correctly and well use the original as it's correct.
Jul 15 '10 #5
NeoPa
32,556 Expert Mod 16PB
US format is m/d/(yy)yy. Not mdyy. US format would avoid all the problems we've discussed.
Jul 15 '10 #6
Ok, probably best I get a new output then and avoid all problems encountered previously. Thanks
Jul 15 '10 #7
NeoPa
32,556 Expert Mod 16PB
If you can get them to change the format they give it to you in that would make it pretty straightforward.

We're more than happy to help further if you need any at that point.
Jul 15 '10 #8
Hi, Well the internal person who gave me the data, to prepare for import, said it was in US format. I contacted the agent myself and found out it was in month/year. After looking into it further, one filed had the month/year and another the ddmmyy format. Therefore it's all been sent back and I'm waiting for a brand new file. Thanks again, this would have caused a lot of problems if it was not picked up.
Jul 16 '10 #9
NeoPa
32,556 Expert Mod 16PB
You're welcome Melissa.

That actually makes much more sense. Obviously the same format should be used throughout, but the myyyy format could certainly be viable if that's what they end up with. Four-digit years are always to be recommended where possible too of course, which this seems to do fine.
Jul 16 '10 #10

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

Similar topics

5
by: Macca | last post by:
Hi, I have a table which has a date/time field. I am storing them as follows :- 01/01/2005 11:25 01/01/2005 19:44 02/01/2005 05:04
1
by: Agnes | last post by:
dim strPeriod as string = dtTransdate.ToString("dd-MMM-yyyy", System.Globalization.DateTimeFormatInfo.InvariantInfo) '--excel code ..Range("H2").Value = strPeriod When I read the excel, the...
4
by: tito | last post by:
In my program i am trying to retrieve 'date' field from an excel sheet .This data is inserted into a My SQL Database.The default format for 'date ' field for Excel sheet is in the form of...
3
by: puruji | last post by:
while importing date field from excel to oracle using VB6 i got a problem in date format....they do no match...in excel it gives date in format mm/dd/yy but in oracle i need dd-mm-yyyy so? to do....
4
xstatic
by: xstatic | last post by:
After searching through the hundreds of links about "Javascript Date Formatting", all I am finding is how to format dates that gives a "current date" result. Here is what I need... I have a...
10
by: ARC | last post by:
Hello all, General question for back-end database that has numerous date fields where the database will be used in regions that put the month first, and regions that do not. Should I save a...
3
by: Bface | last post by:
Hi all, Hope everyone had a good holiday. I am having a difficult time changing the date format of a field from Excel. I have never had this problem before. I link the excel spreadsheet to my DB,...
4
by: kuzen | last post by:
Hi When querying data in a table on date, an error is reported stating the data types do not match (error code 3464). The column format is short date, the query considers that and how short date is...
1
by: accessvbanewbie | last post by:
I would like to export a recordset from access to excel but after each record is exported I want to insert a new row. The first recordset does this ok. However, the second recordset onwards does not...
2
chandru8
by: chandru8 | last post by:
Hi to all, I unable to solve this problem. Iam using vb6.0 anb msaccess 2003 Problem: Iam uploading data from various excel.The problem is with the date format only while uploading the date...
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.