Wrox Programmer Forums
|
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 November 9th, 2007, 01:30 PM
Registered User
 
Join Date: Jan 2006
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default Access Date Problem

I have a date in Access which is coming in as 10012007 without the slashes. I need for the computer to place the slashes between the date as 10/01/2007. Any quick way to do this in a query?

Thanks

jjc9809

Joel Carmack
 
Old November 9th, 2007, 01:34 PM
Authorized User
 
Join Date: Oct 2007
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
Default

What is the property field set at in your query? If it is not set to short date try setting it to that.

 
Old November 9th, 2007, 01:37 PM
Registered User
 
Join Date: Jan 2006
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

The date column called Transdt is coming in from the Mainframe and formatted as Text 10012007

Joel Carmack
 
Old November 9th, 2007, 02:03 PM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

How are you taking this information in? You can always use regular expressions if you know the sending computer is going to preserve leading zeros:

Dim dtDate As Date
Dim sDateString As String

sDateString = "10012007"

'Assuming this is October 1, 2007

dtDate = Left(sDateString, 2) & "/" & Mid(sDateString, 3, 2) & "/" & Right(sDateString, 4)

etc.

Gotta love ETL.

Did that help?


mmcdonal

Look it up at: http://wrox.books24x7.com





Similar Threads
Thread Thread Starter Forum Replies Last Post
date field problem in access asp varia_mahesh Classic ASP Basics 1 June 6th, 2007 07:02 PM
date field problem access asp varia_mahesh Access ASP 0 June 6th, 2007 08:33 AM
Date problem in Access 2003 dkyr VB Databases Basics 2 December 28th, 2005 07:38 PM





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