Solved

Importing an excel file with a problematic date column

Posted on 2013-06-18
7
509 Views
Last Modified: 2013-06-18
Hi,
I have an excel file (attached ) with one column.
the problem is that this column have defferent formatting for a date.
this what i`m getting from external apps as export.

now i`d like to import this file into access.
but when i do that. it doesn`t recognize the column as a date , but as i text.which i don`t want to.
that`s because of the problem with the format.
how can i import the column as a date (fixing the problem through the importing process in access) , if one may help out , maybe using a vba code . or somethen:}
thnx in regard :}
DateProblem.xlsx
0
Comment
Question by:drtopserv
  • 4
  • 3
7 Comments
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 39256480
import the excel file to a temp table.
use a query to format the dates imported to the temp table and append the result to the destination table.

what date format do you have in your destination table?
0
 

Author Comment

by:drtopserv
ID: 39256547
dd/mm/yyyy
but how can i use a query to format it?
may a sample?
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 39256569
select cdate(format([datefield],"dd/mm/yyyy"))
from temptable
0
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

 

Author Comment

by:drtopserv
ID: 39256580
but did you see the column in the excel file, it has 2 formats togother in same column
0
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 500 total points
ID: 39256595
yes i did.. try my suggestion so you can see the result after running the query.

you can then convert the query into an append query.



what is your regional setting?

try this query and see which is more likely to return the correct value

SELECT Sheet2.Started, CDate(Format([Started],"dd/mm/yyyy")) AS Expr1, DateValue([Started]) AS Expr2
FROM Sheet2;
0
 

Author Closing Comment

by:drtopserv
ID: 39256857
I LOVE YOU man!! heheh
it works!!! thnx alot..
plz may u have alook at my open Q:ID: 28158731
0
 

Author Comment

by:drtopserv
ID: 39256859
btw, in excel i couldn`t use :CDate or DateValue (didn`t work for me:} )
0

Featured Post

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A little background as to how I came to I design this code: Around 5 years ago I designed an add-in that formatted Excel files to a corporate standard, applying different cell colours and font type depending on whether the cells contained inputs,…
In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.

789 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question