Convert Text and Numeric in query

pekajo

Registered User.
Local time
Tomorrow, 03:07
Joined
Jul 25, 2011
Messages
135
Hi,

I have a query the appends an access database from an excel spreadsheet (via a link in Access) taken from another program. My problem is that one of the excel columns contains both text and numeric data and I keep getting a 'data mismatch'. I would like to convert both to text I have tried a number of options
exp2:csng([Zip Code])
exp2:Str([Zip Code])
none seem to work.
Does anyone have an idea?

Thanks
Peter.
 
Try:

exp2: Cstr([Zip Code])

However, if it is stored as numbers its not going to replace leading zeroes that should be there. For that I would look into the format function.
 
Or an implicit conversion:

exp2: [Zip Code] & ""

because CStr() will fail if it encounters Null.
 
or you coud format the column in Excel as text, rather than General
 

Users who are viewing this thread

Back
Top Bottom