Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 809
  • Last Modified:

Adding leading zeros to count in a query

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?
0
iambagels
Asked:
iambagels
  • 2
1 Solution
 
Patrick MatthewsCommented:
SELECT Format(Count(*), "00000")
FROM SomeTable
0
 
iambagelsAuthor Commented:
Simple enough. I was trying to do it through the design view GUI the whole time. Thanks.
0
 
Patrick MatthewsCommented:
iambagels,

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.

Regards,

Patrick
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now