473,388 Members | 1,340 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

Field Formatting (zeros)

Fspinelli
Happy Monday Everyone!

I have no idea really how to phrase this so I'll do the best I can...

I have a field named "Strike"

It needs room for 8 characters (numbers) to that field and here's the weird thing:

An example: say you have to enter the number 940 in the Strike field. Once entered it should show up on a report or query as "00940000".

Another example, same thing: say I have to enter the number 1025 in the Strike field...it should show "00102500" as the result.

And yet another: I enter 24 in the Strike field...it should come up in a query or report like "00002400".

There has to be two zeros first, the number, then if there is anything left after that number, fill it with a zero.

Know what I mean?

Thank you!
Sep 20 '10 #1
7 1130
gnawoncents
214 100+
Just to clarify, when you enter 940, do you want 940 or 00940000 to display?
Sep 20 '10 #2
Mariostg
332 100+
So looks like you always pad with two zeros at the front and whatever zeros are required to make the final length of 8 based on the length of the initial number.
So if you have 11, it would be 00110000?
Sep 20 '10 #3
Mr Key
132 100+
Your data is not consistent,
If 1025 gives 00102500 then 940 should gives 00094000
and 24 should gives 00002400
But you said 940 implies to 00940000 this makes your data to be inconsistent. Am I write? or what you have writen is correct? If its correct then its real weird.
If 1024=00102400
924=00092400
24=00002400 then it would be possible to work out. Please clarify more
Sep 20 '10 #4
OldBirdman
675 512MB
=Left("00" & [Strike] & "000000", 8)
Sep 20 '10 #5
Yes, Mariost - I'm pretty sure you get what I'm trying to ask. I'm still crossing my eyes with the zeros, but there is always two in the front, the number, then followed by how many places are left with zeros. Yes, my regular numbers have some (zero) padding front and back. It just adjusts with whatever number.

I don't know why they want it to look that way (padded zeros before and after number), but they sign my paycheck and I figure if it can be done I'm going to learn how!

Thank you - any suggestions/advise/info is greatly appreciated!
Sep 20 '10 #6
Mariostg
332 100+
Fspinelli,
Hey as long as it meets the requirement, that's what counts. That being said, the solution proposed by OldBirdMan is clean and should certainly do.
Sep 21 '10 #7
Thank you (everyone)! I will try OldBirdMan's solution.
Sep 21 '10 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: CSDunn | last post by:
Hello, In an Access 2003 ADP Subform, I am trying to set the BackGround color of three textbox fields (LSScore, RScore, WScore) in the current record of the subform to zero (black) if the value of...
4
by: Dave Brydon | last post by:
Access 2003 I have a combo box in my personnel table, which draws its data from a trade code table; the original field in the code table, is numeric, Long Integer, and formatted with 5 zero's . ...
8
by: shumaker | last post by:
I see other posts where some say fields that will hold a number with leading zeros should be stored as text instead of numbers. This is very inefficient though, as a string of digit characters...
1
by: Duppypog | last post by:
I want the contents of a textbox to be ALL CAPS when added to the database. How do I do that? And on the flip side - if I have existing data, what's the data formatting expression for ALL CAPS...
5
by: Bilgehan.Balban | last post by:
Hi, I use %#08x to print unsigned integers in hexadecimal format. According to C ref. man. Harbison & Steele, #08 stands for "pad the number with up to 8 zeroes to complete it to 8 digit...
2
by: sgtted71 | last post by:
I have searched the Word Help and the Access Help, I have consulted the well used Access Bible that sits behind my desk, and to no avail...so now I consult the mighty brain trust that is...
4
by: Rotsey | last post by:
Hi, I have written a custom multi column listbox control that I pass a datatable to. the issue is that if there are date fields then these may be in the wrong format or any other field...
6
by: JimmyKoolPantz | last post by:
Task: Customer wants a script of the data that was processed in a "CSV" file. Problem: Zip-Code leading zeros are dropped Basically we have a client that has requested a custom script for...
5
by: Rowan | last post by:
Hi, I am somewhat new to .net and c#. (What I learned in previous co has to be unlearned). I am doing something that seems simple but I think there is a better way than how I learned to do it. ...
4
by: Shaft11 | last post by:
I have a memo field that time/date stamps new entries to the field. What I’m trying to do is for entries that are more than 1 line, the second or subsequent lines are moved under the first line past...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.