Adding leading zeros to count in a query

Posted on 2007-07-24
Last Modified: 2012-05-05
In a MS Access query, how can I format the display of a count so that it has leading zeros to pad the number to 5 digits on export. I have gotten it to display the five digits on the screen, but when exporting it only displays the count without any leading zeros. Any suggestions?
Question by:iambagels
    LVL 92

    Accepted Solution

    SELECT Format(Count(*), "00000")
    FROM SomeTable
    LVL 2

    Author Comment

    Simple enough. I was trying to do it through the design view GUI the whole time. Thanks.
    LVL 92

    Expert Comment

    by:Patrick Matthews

    You're welcome.  The problem is that what you were doing affects only how the data are displayed
    in Access, and does nothing to change the underlying data.



    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Top 6 Sources for Identifying Threat Actor TTPs

    Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

    PaperPort has a feature called the "Send To Bar". It provides a convenient, drag-and-drop interface for using other installed software, such as Microsoft Office. However, this article shows that the latest Office 2016 apps (installed with an Office …
    No matter the version of Windows you are using, you may have some problems with Windows Search running too slow or possibly not running at all. Before jumping into how you can solve this issue, just know there are many other viable alternative deskt…
    Learn how to create and modify your own paragraph styles in Microsoft Word. This can be helpful when wanting to make consistently referenced styles throughout a document or template.
    Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

    761 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    9 Experts available now in Live!

    Get 1:1 Help Now