Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access VBA
|
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 18th, 2007, 03:21 PM
Registered User
 
Join Date: Jun 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Convert text from excel to proper date in access

Hi, I'm running into a strange problem that I can't get around and was wondering if anyone had any suggestions for me. I have some date and time fields in an excel sheet that display correctly (01/01/2007) even though the value is something like 37564. Same story for two columns that contain times.

When I import them to access, the numeric value of the date and time is imported (e.g. 37564 and .273423423).

How can I convert these to human dates and times?

Here's what I've tried so far:

Re-importing the table --> Access won't give me an option to set the field type for some reason

Changing the properties of the field --> Access deletes all the values when I change the field to date/time format

Changing the field from Date or Time in Excel to "Text" --> converts all the values to 37564 and 0.273452345 type values, instead of human date and time


=TEXT (A11, "hh:mm") in excel --> converts it to military time and I lose AM and PM.


Any suggestions on how I can import this? Thanks!

Bhavesh



 
Old June 18th, 2007, 03:48 PM
Registered User
 
Join Date: Jun 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Well, I figured out one way to do it....results were a little disappointing, but it worked. I used the Text to Columns feature of Excel, which converted the Dates to text, and the Times to text...only problem is that the times got changed to a goofy hh:mm:ss PM format... e.g. 4:15:00 PM .

Still would be interestedin better solutions if anyone has anything. Thanks.








Similar Threads
Thread Thread Starter Forum Replies Last Post
Convert Excel to Access MrQwest Access 3 February 5th, 2007 08:59 AM
Replacing abbreviation with proper text Brendan Bartley Access 2 June 2nd, 2006 08:03 AM
Similar to the PROPER function in EXCEL mcinar HTML Code Clinic 7 March 29th, 2005 12:34 PM
Convert Text to Date/Time in Access mmcdonal Access VBA 7 June 15th, 2004 12:19 PM
Error Data When Convert Excel to Access rpitoyo Pro VB Databases 0 August 5th, 2003 12:05 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.