473,396 Members | 2,147 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,396 software developers and data experts.

how to set the field with no zero in the beginning

I have question about how to save record in table without 0 in the beginnng. I have created databse in which Item number is a field. Item number have more than 15 numbers. I used text instead of numbers. When i scan item number some start with 0 in the beginning and some dont. there are chances to scan same numbers again. when I scan it is dupliating. when i scan first with 0 in the beginning and no 0 next time. for instance, item number is 456789. When i scan, it appears as 0456789 as it shows that way in label. but in the box it shows as 456789. if I scan from the box it takes as 456789. they both are same but just becasue there is 0 in the beginning, it is stored as two different item number. how do I avoid this?
Apr 19 '11 #1
8 1647
dsatino
393 256MB
Ok, I think I understand your problem, but I'm not exactly sure. My interpretation is that you can scan the same exact item and get two different item numbers depending on whether you scan the label or box. If that's the case, you basically have two options:

1. if your item numbers will always be numeric, then simply change the item number field to a numeric and the leading zero's will be dropped automatically. Numeric indexes are faster anyway, so unless you have an absolute need to store them as text you just change it.

2. If you need to keep the text format for the item number field then you can test if the item number is numeric and then format it to fit your needs.
Apr 19 '11 #2
Thanks for your reply. The reason I have Item number is Text format is they are always more than 15 digits. so If I have in number, they are not accepting it. Do you have any other options please. Thanks
Apr 19 '11 #3
gershwyn
122 100+
The default numeric type is long integer, which is not capable of storing a 15-digit number, but there are types that are.

Change the data type to Number, then below in the field properties change Field Size to decimal and precision to how many digits you need (up to 28, in Access 2007.)
Apr 19 '11 #4
dsatino
393 256MB
Size of the number only matters if the data type you use for your field is to small to accept it.

What's the most number of digits you have in any item number?
Apr 19 '11 #5
I have 21 digits of number in Item number.
Apr 21 '11 #6
Thanks for your reply. I did the same to the database. I have almost 6500 records now. I got another problem after I changed the tables to number. Now I couldn't find the records. I enter the item number in Control F to find but it's not searching anymore. Can you please help me with this?
Apr 21 '11 #7
dsatino
393 256MB
Then change the field type to Decimal. Set the precision to 21 (or higher) and set the scale to 0.
Apr 21 '11 #8
Thanks for the reply. I did this already and it is working. I do have another problem. Now I couldnt search the record. I enter or scan the item number using Control F to find. But it is not searching.. I tried with more than 20 numbers. No searching at all.. Can you please help me with this issue. Thanks.
Apr 21 '11 #9

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

Similar topics

7
by: Rick Caborn | last post by:
Does anyone know of a way to execute sql code from a dynamically built text field? Before beginning, let me state that I know this db architecture is built solely for frustration and I hope to...
2
by: Gary | last post by:
Morning all, I have a form field called: Bsk01 How do I onBlur prompt the user to enter a ZERO as character one, if one is not already entered. At the same time, I would like to ensure at...
3
by: Ronnie | last post by:
Hi All, A newbie here having a hard time figuring out how to parse out the City, State and Zip from a text field. I have a text field called "Registration" with a size of 40. In this field...
1
by: Sami | last post by:
Title says it all. Using a Listbox to look up numbers - ie SSN for a student - and then all of a sudden it shows up as 2323E+08 instead of say 232-23-2323. Help! Also, how can I force zeroes...
6
by: Sami | last post by:
Problem: Social Security number being used in a database. First problem is that it will not permit numbers beginning in zero to be entered - it sees it as a null or empty space from what I can...
25
by: Lyn | last post by:
Hi, I am working on a genealogy form. The only table (so far) lists everybody in the family, one record per person. Each record has an autonum ID. The parent form (frmMainForm) displays the...
2
by: Steve | last post by:
I have a database where I want to use an autonumber field to make SKUs for a new product when it is entered. Is there a way I can make the field zero fill to a certain length? For instance, if I...
27
by: Kim Webb | last post by:
I have a field on a form for project number. I basically want it to be the next available number (ie 06010 then 06011 etc). In the form I create a text box and under control source I put: =!=...
31
by: Zero | last post by:
Hi everybody! Is it possible to write a value into a bit field which initializes all bits? example: struct Field { unsigned int Bit1 : 1;
3
by: fperri | last post by:
I have a field in my main table called "CHANGE". Each week before we update the data we create a backup of the table and adjust the CHANGE field for all records to zero. I have an update query where...
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:
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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.