Convert text to number in query

bkanealy

Registered User.
Local time
Today, 14:26
Joined
Mar 30, 2004
Messages
10
All,

I have two tables one is linked from an AS400. The first table is an extract where the field I want to search is text, but the field in the linked table is a number. I've been trying to use the "format" function in a query and then use the query to pull against the linked table, but I'm getting an error;

Type mismatch in JOIN expression.

Here is the formula I'm using to convert the text to a number.

Newfield: Format(Mid([Fieldname],8,6),"000000")

Am I close? Thanks in advance
Brian
 
If it's a long integer:

NewField: CLng(Mid([Fieldname],8,6))


For a short integer use CInt and use CSng or CDbl for decimal numbers.
 
RichO said:
If it's a long integer:

NewField: CLng(Mid([Fieldname],8,6))


For a short integer use CInt and use CSng or CDbl for decimal numbers.


Rich,

Thanks very much.

Brian
 

Users who are viewing this thread

Back
Top Bottom