[Webinar] Streamline your web hosting managementRegister Today

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

Count Leading Zero

I'm using zip codes to sort and compile information and I have a query where I run an inventory of people in a 3 digit zip code range like this

Left([qryLastMail]![zip],3) AS 3DigZip

The problem I'm having is in the zip codes where there is a leading zero like in MA 01001 the query returns 100 instead of the 010. How can I get it to count the leading zero. The field is already formatted with 5 digits and when I do the query to show all five it returns the numbers with the leading zero just fine.
0
athomas79
Asked:
athomas79
  • 3
1 Solution
 
mcorrenteCommented:
left(cstr([qrylastmail]![zip],3) as 3digzip
0
 
mcorrenteCommented:
if not, try left(format([qrylastmail]![zip],"00000"), 3) as 3digzip
0
 
athomas79Author Commented:
The changing it to a string didn't work, but formatting it again in the query before the taking left three digits worked great, Thanks!
0
 
mcorrenteCommented:
no problem.
0

Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

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