PC Review


Reply
Thread Tools Rate Thread

Change number format in linked table

 
 
=?Utf-8?B?SnVkeQ==?=
Guest
Posts: n/a
 
      25th Apr 2007
I need to make a table using fields from a linked Oracle database. The SSN
field in the Oracle database is a Number, not text. Where there are leading
zeros, they are dropped. I need a way to replace the leading zeros in my new
table.
 
Reply With Quote
 
 
 
 
John W. Vinson
Guest
Posts: n/a
 
      25th Apr 2007
On Tue, 24 Apr 2007 17:02:01 -0700, Judy <(E-Mail Removed)>
wrote:

>I need to make a table using fields from a linked Oracle database. The SSN
>field in the Oracle database is a Number, not text. Where there are leading
>zeros, they are dropped. I need a way to replace the leading zeros in my new
>table.


You can use a calculated field:

Format([numberfield], "000000000")

or, if you want to actually store the hyphens,

Format([numberfield], "000-00-0000")

This function will return a Text datatype value which can be appended into a
text field in your local table.

John W. Vinson [MVP]
 
Reply With Quote
 
 
 
 
=?Utf-8?B?SnVkeQ==?=
Guest
Posts: n/a
 
      25th Apr 2007
Thanks, John. This is my first attempt to use this site - I had no idea so
much help was available.

"John W. Vinson" wrote:

> On Tue, 24 Apr 2007 17:02:01 -0700, Judy <(E-Mail Removed)>
> wrote:
>
> >I need to make a table using fields from a linked Oracle database. The SSN
> >field in the Oracle database is a Number, not text. Where there are leading
> >zeros, they are dropped. I need a way to replace the leading zeros in my new
> >table.

>
> You can use a calculated field:
>
> Format([numberfield], "000000000")
>
> or, if you want to actually store the hyphens,
>
> Format([numberfield], "000-00-0000")
>
> This function will return a Text datatype value which can be appended into a
> text field in your local table.
>
> John W. Vinson [MVP]
>

 
Reply With Quote
 
rbeach
Guest
Posts: n/a
 
      9th Apr 2009
This returns a text datatype. How do set this to a number rather than a text?
--
Rick


"John W. Vinson" wrote:

> On Tue, 24 Apr 2007 17:02:01 -0700, Judy <(E-Mail Removed)>
> wrote:
>
> >I need to make a table using fields from a linked Oracle database. The SSN
> >field in the Oracle database is a Number, not text. Where there are leading
> >zeros, they are dropped. I need a way to replace the leading zeros in my new
> >table.

>
> You can use a calculated field:
>
> Format([numberfield], "000000000")
>
> or, if you want to actually store the hyphens,
>
> Format([numberfield], "000-00-0000")
>
> This function will return a Text datatype value which can be appended into a
> text field in your local table.
>
> John W. Vinson [MVP]
>

 
Reply With Quote
 
John Spencer MVP
Guest
Posts: n/a
 
      9th Apr 2009
SSN should be text. You won't use them for arithmetic.

IF you need to store leading zeroes in the field then you cannot store the
value as a number, you have to store the data as text.

If you insist on having the SSN stored as a number then your only choice is to
format the SSN when you display it using either the format property of the
control set to "000-00-0000" or "000000000" or using the format function in
the underlying query to return the formatted value.

Format(SSN,"000-00-0000")


John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County

rbeach wrote:
> This returns a text datatype. How do set this to a number rather than a text?

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Access 2007 - Copy linked table to a local table or have linked tableas read-only Stuart Microsoft Access 0 26th May 2012 10:28 PM
ACCESS table linked to EXCEL spreadsheet. How to know which table is linked? Art Microsoft Access 3 2nd Apr 2007 12:51 PM
ACCESS table linked to EXCEL spreadsheet. How to know which table is linked? Art Microsoft Excel Discussion 3 1st Apr 2007 10:14 PM
Help updating table from linked table(linked table is a csv) Thierry Microsoft Access Queries 2 29th Jun 2004 02:21 PM
UPDATE a linked access table with value from a ODBC linked SQL table JB Microsoft Access 0 18th Nov 2003 10:27 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:03 PM.