Format a number as a text in a query (1 Viewer)

casey

Registered User.
Local time
Today, 20:22
Joined
Dec 5, 2000
Messages
448
Hello,
I have a text file I'm querying that stores a field as a text.
ComponentID:0000000242

I'm inserting this data into a table that stores this value as a number. Thus truncating the leading zeros.
ComponentID:242

I would like to create a query on the table using an InnerJoin on the text file column:ComponentID:0000000242 and the table column:ComponentID:242 as the unique identifier. Doing this join gives a case error because of the different data types.

Can format ComponentID using a query so it reads from my table as 0000000242 and do an InnerJoin to the text file. In vb
Code:
String= Format(242, "0000000000")
But I'm finding it difficult to get the query to format this correctly.

Unfortunately, i'm unable to change the column data type in the table structure and am looking for a work around. Is this even possible? Any ideas?

Thanks.
 

casey

Registered User.
Local time
Today, 20:22
Joined
Dec 5, 2000
Messages
448
Got it

Basically did what I described and it worked. not sure why it didn;t take the first time.
 

Users who are viewing this thread

Top Bottom