Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Zero fill a value?

Status
Not open for further replies.

bravo6

IS-IT--Management
Mar 23, 2006
83
US
I am working with latitudes and longitudes and need a query to make some values fit the format of latitude/longitude that the client program will recognize. All figures need to be 6 digits (some may have a negative sign at the front) and have a period after the first two numbers. So the finished format will look like -NN.NNNN or NN.NNNN.

What I'm starting with does not include zeros to the left if it is a short number. Nor does it include the period.

Examples:
I need to make this -1333 into this -00.1333
I need to make this 388491 into this 38.8491
I need to make this 67667 into this 06.7667
I need to make this -234350 into this -23.4350

Can someone help me create an Access querie(s) to get this done?

Thanks!!
 
SELECT Format([your field]/10000,"00.0000") AS [your alias]
FROM [your table]

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Thanks very much. I was really over thinking that.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top