Solved

Importing an excel file with a problematic date column

Posted on 2013-06-18
7
507 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 119

Expert Comment

by:Rey Obrero
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 119

Expert Comment

by:Rey Obrero
ID: 39256569
select cdate(format([datefield],"dd/mm/yyyy"))
from temptable
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

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 119

Accepted Solution

by:
Rey Obrero 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
The view will learn how to download and install SIMTOOLS and FORMLIST into Excel, how to use SIMTOOLS to generate a Monte Carlo simulation of 30 sales calls, and how to calculate the conditional probability based on the results of the Monte Carlo …
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.

743 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now