A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Link AutoNumber to Text Field



 
 
Thread Tools Display Modes
  #1  
Old February 15th, 2007, 09:24 PM posted to microsoft.public.access.queries
mattc66 via AccessMonster.com
external usenet poster
 
Posts: 210
Default Link AutoNumber to Text Field

Hi All,

I have 2 tables that I need to link the AutoNumber to a Text Field in another
table. Is this possible?

If so, how do I do it?

Matt

--
Matt Campbell
mattc (at) saunatec [dot] com

Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...eries/200702/1

  #2  
Old February 15th, 2007, 09:55 PM posted to microsoft.public.access.queries
KARL DEWEY
external usenet poster
 
Posts: 10,767
Default Link AutoNumber to Text Field

No you can not as one is datatype of long integer and the other is text. The
data stored for a numerial one and a text one are totally different.

Why not change the text field to a number, long integer?

Alternately I think you can create a query of the table that has the text
field and output the field as a number field.
NumField: CLng([YourFieldName])
Then link your autonumber table to the query.

"mattc66 via AccessMonster.com" wrote:

Hi All,

I have 2 tables that I need to link the AutoNumber to a Text Field in another
table. Is this possible?

If so, how do I do it?

Matt

--
Matt Campbell
mattc (at) saunatec [dot] com

Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...eries/200702/1


  #3  
Old February 15th, 2007, 10:11 PM posted to microsoft.public.access.queries
mattc66 via AccessMonster.com
external usenet poster
 
Posts: 210
Default Link AutoNumber to Text Field

The trouble is the data comes from an external UPS database that has some
items in the fld that are text. I am trying to only link the items in the
table that match to my database which is an autonumber fld.



KARL DEWEY wrote:
No you can not as one is datatype of long integer and the other is text. The
data stored for a numerial one and a text one are totally different.

Why not change the text field to a number, long integer?

Alternately I think you can create a query of the table that has the text
field and output the field as a number field.
NumField: CLng([YourFieldName])
Then link your autonumber table to the query.

Hi All,

[quoted text clipped - 4 lines]

Matt


--
Matt Campbell
mattc (at) saunatec [dot] com

Message posted via http://www.accessmonster.com

  #4  
Old February 15th, 2007, 11:10 PM posted to microsoft.public.access.queries
KARL DEWEY
external usenet poster
 
Posts: 10,767
Default Link AutoNumber to Text Field

Ok, then you will need to do the query and also use another field like this ---
NumField_2: Val([YourFieldName])
Then have criteria 0

With the criteria you will pull only nunbers.

"mattc66 via AccessMonster.com" wrote:

The trouble is the data comes from an external UPS database that has some
items in the fld that are text. I am trying to only link the items in the
table that match to my database which is an autonumber fld.



KARL DEWEY wrote:
No you can not as one is datatype of long integer and the other is text. The
data stored for a numerial one and a text one are totally different.

Why not change the text field to a number, long integer?

Alternately I think you can create a query of the table that has the text
field and output the field as a number field.
NumField: CLng([YourFieldName])
Then link your autonumber table to the query.

Hi All,

[quoted text clipped - 4 lines]

Matt


--
Matt Campbell
mattc (at) saunatec [dot] com

Message posted via http://www.accessmonster.com


  #5  
Old February 16th, 2007, 12:57 AM posted to microsoft.public.access.queries
Rick Brandt
external usenet poster
 
Posts: 4,354
Default Link AutoNumber to Text Field

mattc66 via AccessMonster.com wrote:
Hi All,

I have 2 tables that I need to link the AutoNumber to a Text Field in
another table. Is this possible?

If so, how do I do it?


SELECT *
FROM Table1 INNER JOIN Table2
ON CStr(Table1.AutoNumberField) = Table2.TextField

You will only be able to write the above query in SQL view and it will not be
very efficient as the index on the AutoNumber field cannot be utilized, but it
will work.

--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com


 




Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 12:23 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.