Welcome to Windows Help!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Automate Change of the format of a field to short date for..

 
   Windows Help (Home) -> Microsoft Access RSS
Next:  User Profiles exe?  
Author Message
Chuck W

External


Since: Apr 1, 2009
Posts: 5



(Msg. 1) Posted: Tue Feb 16, 2010 6:53 am
Post subject: Automate Change of the format of a field to short date for export
Archived from groups: microsoft>public>access (more info?)

Hi,
I have a table that I am creating through a make table query. Once created,
I want to export the table to a text file and save to a location. I am
attempting to create a macro that will do this. One of my fields is called
CMMonth. The problem is that when I export this table to a text file, it is
exporting this field as a long date with hours:minutes:seconds. The system I
am importing the text file to rejects the long date. I can only be M/D/Y. I
have tried changing the field format manually once the table is created but
it still exports it as a long date. How can I change this so that the format
is only a short date and also put the format change in a macro or in a query
that goes into a maco?
Thanks,

 >> Stay informed about: Automate Change of the format of a field to short date for.. 
Back to top
Login to vote
Daryl S

External


Since: Oct 19, 2009
Posts: 13



(Msg. 2) Posted: Tue Feb 16, 2010 9:36 am
Post subject: RE: Automate Change of the format of a field to short date for export
Archived from groups: per prev. post (more info?)

Chuck -

If this table is being re-created each time, and only used for the export,
you can make the date field a text field, and the make-table query can format
the date to the string you need for the export.

 >> Stay informed about: Automate Change of the format of a field to short date for.. 
Back to top
Login to vote
John W. Vinson

External


Since: Nov 28, 2008
Posts: 104



(Msg. 3) Posted: Tue Feb 16, 2010 10:35 am
Post subject: Re: Automate Change of the format of a field to short date for export
Archived from groups: per prev. post (more info?)

On Tue, 16 Feb 2010 06:53:02 -0800, Chuck W
wrote:

>Hi,
>I have a table that I am creating through a make table query. Once created,
>I want to export the table to a text file and save to a location.

Why the extra step? There's a LOT of overhead in a MakeTable query, and it's
prefectly possible to just change the MakeTable query to a SELECT query, and
export *that query*.

>I am
>attempting to create a macro that will do this. One of my fields is called
>CMMonth. The problem is that when I export this table to a text file, it is
>exporting this field as a long date with hours:minutes:seconds. The system I
>am importing the text file to rejects the long date. I can only be M/D/Y. I
>have tried changing the field format manually once the table is created but
>it still exports it as a long date. How can I change this so that the format
>is only a short date and also put the format change in a macro or in a query
>that goes into a maco?
>Thanks,

The export process completely ignores the format settings of fields being
exported. The solution is to explicitly cast the date field as a Text, using
the Format() function. Rather than exporting [CMMonth] use an expression in
the query:

ExpCMMonth: Format([CMMonth], "mm/dd/yyyy")

or whatever format you wish.
 >> Stay informed about: Automate Change of the format of a field to short date for.. 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
Format Date #/#/# - I am trying to use a function that I have used in the past but for some reason today when I type it in the query field and run my report Access is converting "####/##/##" to #\/#\/# and I receive an error message in that field for my query r...

Date Format - how can i set the date format from 8/30/2009 to August, 2009?? This date is on my subform. any idea?

Custom Date Format - How do I create a date format? I need the format to be: YYYYMMDD. Thanks

Finding a year in a date field - I need to pull all records for 2008 in a date field called completed. I know this shoudl be easy but I can never seem to find any help on date fields that seems to relate. I just want to create a simple query.

date format - excluding year - Hello again - I'm having trouble entering dates without the year. I want to keep the year in a separate column (so I can sort or filter by year). I know I should be able to format it using dd-mmm, but as soon as I export it to Excel, 2009 is ..
   Windows Help (Home) -> Microsoft Access All times are: Pacific Time (US & Canada)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]