Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access VBA
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old June 18th, 2007, 03:21 PM
Registered User
 
Join Date: Jun 2007
Location: , , .
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



Reply With Quote
  #2 (permalink)  
Old June 18th, 2007, 03:48 PM
Registered User
 
Join Date: Jun 2007
Location: , , .
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.



Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 03:30 AM.


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