Results 1 to 2 of 2
  1. #1
    sam.eade is offline Novice
    Windows 8 Access 2010 64bit
    Join Date
    Sep 2013
    Posts
    29

    Formatting Field in a Query for text export

    Hi all,

    I’m currently using an expression in a query to count the amount of records in a separate query. For example, it will show how many sales there are on a given day.

    This is the expression I am using,

    Code:
     Record Count: DCount("*","Export Body1")
    I’m trying to export this query into a text file and the output needs to be 8 characters long preceded by 0’s.
    i.e. if there are 13 sales, I need the output to be “00000013” but if there was just one sale it would be “00000001”.

    Can anyone help me with how to format this? I have limited SQL and VBA knowledge but if you spelled it out for me I’m sure I could input the code.



    Thanks

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,525
    format(DCount("*","Export Body1"),"00000000")

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

Similar Threads

  1. Export query to Excel and apply conditional formatting
    By mcpearce in forum Import/Export Data
    Replies: 4
    Last Post: 04-27-2014, 05:26 PM
  2. Replies: 7
    Last Post: 03-03-2014, 01:36 PM
  3. Query Export formatting issues
    By jle0003 in forum Queries
    Replies: 1
    Last Post: 08-02-2013, 08:50 AM
  4. Formatting text of an export
    By Sarge, USMC in forum Import/Export Data
    Replies: 11
    Last Post: 02-27-2013, 09:08 PM
  5. Replies: 1
    Last Post: 04-26-2012, 08:31 PM

Tags for this Thread

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