Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Exporting Date to Text File

Hi,
I'm writing a macro that exports a range to a text file which will ultimately be uploaded to a database. This upload requires the date to be in a specific format, ie. dd-mmm-yy. When I use the open command to write to, it automatically puts it in a yyyy-mm-dd format. Is there a way to force the dd-mmm-yy format when outputting to text file with the write command?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 131
Default Exporting Date to Text File

The Write statement automatically converts date to
universal date format, i.e. the yyyy-mm-dd you are
getting. You can force the conversion to another format
by using the format function: Format(DateVar,"dd-mmm-yy").

So, for example:
Write#1 Var1, Var2, Format(DateVar,"dd-mmm-yy"),...

-----Original Message-----
Hi,
I'm writing a macro that exports a range to a text file

which will ultimately be uploaded to a database. This
upload requires the date to be in a specific format, ie.
dd-mmm-yy. When I use the open command to write to, it
automatically puts it in a yyyy-mm-dd format. Is there a
way to force the dd-mmm-yy format when outputting to text
file with the write command?
.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default Exporting Date to Text File

Maybe you can write the formatted date:

..... format(myCell.value, "dd-mmm-yyyy")...



Dan T wrote:

Hi,
I'm writing a macro that exports a range to a text file which will ultimately be uploaded to a database. This upload requires the date to be in a specific format, ie. dd-mmm-yy. When I use the open command to write to, it automatically puts it in a yyyy-mm-dd format. Is there a way to force the dd-mmm-yy format when outputting to text file with the write command?


--

Dave Peterson

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Exporting excel to text file Exceluser Excel Discussion (Misc queries) 1 July 1st 05 03:04 AM
Exporting excel to text file Exceluser Excel Discussion (Misc queries) 1 June 22nd 05 11:26 PM
Exporting excel to text file Exceluser Excel Discussion (Misc queries) 1 June 22nd 05 05:33 AM
Exporting from Excel to a text file Josh Brien Excel Discussion (Misc queries) 3 May 20th 05 09:54 PM
Exporting Text File Ray Ray[_2_] Excel Programming 1 August 17th 03 03:33 PM


All times are GMT +1. The time now is 08:20 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"