Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Field with both Text and Number

Status
Not open for further replies.

jrmiv

Technical User
May 14, 2007
13
US
I have a query pulling results from an ODBC table where the field has both numeric and text fields. I want to exclude the text lines. (not like a number) because my next query links by this field to another table which is a numeric field.

i.e.
line 1 = IPP (want to exclude this line from query results)
line 2 = 12345
line 3 = RTN (exclude)
 
so in the query you'll do something like this:

Code:
SELECT * FROM NumberTable N
INNER JOIN TextTable T ON T.TextField = Char(N.NumberField)

basically, convert the number field to a text field, join and you'll only get the numbers from the TextTable because that's the way joins work (inner joins at any rate).

HTH

Leslie

In an open world there's no need for windows and gates
 




You will have problems querying a COLUMN that contains BOTH numeric and text data. The Query Manager scans the first 8 rows, or so, and ASSUMES what kind of data to read. If it "sees" text, then ALL the numeric data is "INVISIBLE". Conversely, all the text data would be invisible.

Skip,

[glasses]I'll be dressed to the nines this week, as I go to have my prostatectomy...
Because, if I'm gonna BE impotent, I want to LOOK impotent![tongue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top