473,396 Members | 1,935 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.

Loss of Data Converting Text to Number

Hi everyone-

I'm trying to convert social security numbers from a text data type to
a number data type, but I lose data on some of the social security
numbers, especially SS#s with 0's in them. For example: 123-45-6789
might become 45-6789. This happens in about 20% of the SS#s.

I tried opening the table then switching text to number. I also tried
creating a new table, changing the field from text to number, then
running an append query, but I still lose data and get incomplete
SS#s.

Can anybody give me any suggestions. I'm not much of a VBA coder yet.

Thanks a bunch!

Megan
Nov 13 '05 #1
2 1593
On 25 Jul 2004 20:27:31 -0700, me**************@hotmail.com (Megan)
wrote:
Hi everyone-

I'm trying to convert social security numbers from a text data type to
a number data type, but I lose data on some of the social security
numbers, especially SS#s with 0's in them. For example: 123-45-6789
might become 45-6789. This happens in about 20% of the SS#s.

I tried opening the table then switching text to number. I also tried
creating a new table, changing the field from text to number, then
running an append query, but I still lose data and get incomplete
SS#s.

Can anybody give me any suggestions. I'm not much of a VBA coder yet.


Question. Why would you want to use a numeric data type for SS#s?
The only reason for a number is to perform an arithmetic operation on
it. Which you should never do on an ID. Answer yourself that question
and then proceed.

- Jim
Nov 13 '05 #2

But 123-45-6789 is not a number it's a string and so should be stored in a
text field.
--
Terry Kreft
MVP Microsoft Access
"Megan" <me**************@hotmail.com> wrote in message
news:5c**************************@posting.google.c om...
Hi everyone-

I'm trying to convert social security numbers from a text data type to
a number data type, but I lose data on some of the social security
numbers, especially SS#s with 0's in them. For example: 123-45-6789
might become 45-6789. This happens in about 20% of the SS#s.

I tried opening the table then switching text to number. I also tried
creating a new table, changing the field from text to number, then
running an append query, but I still lose data and get incomplete
SS#s.

Can anybody give me any suggestions. I'm not much of a VBA coder yet.

Thanks a bunch!

Megan

Nov 13 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Hal Vaughan | last post by:
If I have a byte and I convert it to string (String sData = new String(byte bData), then convert it back (byte bData = sData.getBytes()), will all data be intact, or do Strings have problems with...
5
by: Michael Hill | last post by:
Hi, folks. I am writing a Javascript program that accepts (x, y) data pairs from a text box and then analyzes that data in various ways. This is my first time using text area boxes; in the past,...
9
by: HelmutMunich | last post by:
Hello, I am Helmut, my database for multiuser is Frontend/Backend. The turnover file is browsed by VBA for Article numbers to be found in the article table. I use DAO 3.6 lib. The sql Statement...
10
by: Mike | last post by:
I know this sounds strange but I am at a loss. I am calling a simple funtion that opens a connection to a SQL Server 2000 database and executes an Insert Statement. private void...
13
by: imnewtoaccess | last post by:
Hi, I am getting errors while inserting records in one table from another. These are the structures of two tables : file51tm_new RecordType Text
23
by: neha_chhatre | last post by:
which is the best format specifier(data type) if i have to work with decimal number. also please tell me the syntax for truncating a decimal number please reply as soon as possible
1
by: foxygrandma | last post by:
I am having data type problems. The first thing I had to do was convert the weight of one column from kg to lb. I did this by multiplying by 2.20462262 and updating a new column, however, the...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
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
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.