Results 1 to 4 of 4
  1. #1
    Back2Basics is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Feb 2010
    Posts
    28

    Export to .dat with date formatting

    Hi



    I have created a query with all of the fields that I need and it looks exactly how I want it. I can export this as a .txt or .csv file but when I look at the data any fields that contact a data display the date and time (dd/mm/yyyy hh:mm:ss) and I have formatted the field in the query so that it displays as DD-MMM-YYYY in the datasheet view. I need to export the data with this formatting as this is how the system requiring the data needs the file to be displayed.

    So my questions two-fold:

    1) how do I export so that the formatting is included in the export
    2) can I export as a .dat without simply manually changing the extension afterwards?

    My knowledge of access is very limited. I have enough knowledge to build something pretty simple, which is lucky because that's what I've done - but this exporting business is beyond me really so I would be grateful of any help.

  2. #2
    jwhite is offline Competent Performer
    Windows 10 Access 2013 32bit
    Join Date
    Dec 2012
    Location
    North Carolina
    Posts
    349
    How are you doing your export right now? Your answer depends on what will be recommended for Question #2. Generally speaking, if you use DateValue(yourdatetimefield) it will return just the date portion.

  3. #3
    Back2Basics is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Feb 2010
    Posts
    28
    I am currently exporting using the "External Data > Export > Text File" route manually, this is partly because I am not getting the result I want and I keep testing it using this method. I am open to suggestions of how to export it in a different manner - my aim is to include a button on a form that exports the required file to a desired location, but as I don't have what I need yet I haven't got that far.

    I have tried the suggestion of using DaveValue (). I have been using DateValue (Date()) as I want to display the date the file is exported. however, when I export this as a .txt file it still displays the date and time.

    Thanks for the quick reply

  4. #4
    jwhite is offline Competent Performer
    Windows 10 Access 2013 32bit
    Join Date
    Dec 2012
    Location
    North Carolina
    Posts
    349
    Check into the DoCmd.TransferText method.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Formatting Access Export to Excel
    By derekben in forum Access
    Replies: 1
    Last Post: 07-09-2013, 02:30 PM
  2. Formatting text of an export
    By Sarge, USMC in forum Import/Export Data
    Replies: 11
    Last Post: 02-27-2013, 09:08 PM
  3. Excel export formatting
    By tariq nawaz in forum Import/Export Data
    Replies: 0
    Last Post: 09-24-2012, 05:30 AM
  4. Replies: 3
    Last Post: 01-17-2011, 08:13 PM
  5. Export Formatting
    By arthura in forum Import/Export Data
    Replies: 0
    Last Post: 02-20-2009, 08:44 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums