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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Linked Field Format 1

Status
Not open for further replies.

palnud

Programmer
Mar 11, 2002
7
US
I'm importing a text field, and the negative numbers are in parenthesis. They come into the table field as an error, #Num!. How do handle this?

Thanks.
 
Yes, it's odd that Access can't recognize an Excel number format like (1234.56) as a negative, but, that's what makes life interesting. [curse]

You'll need to import the field as pure text, then run an update query to strip off the parentheticals and add a dash to the front and then you can go in to table design to convert the field back to a Number datatype.

The tricky part is stripping off the two parens. I'll assume that they are the FIRST and LAST characters of the field..

Your update query will need a function like this:

MyNumber = "-" & Mid(MyNumber, 2, Len(MyNumber)-1)

Before: MyNumber = (1234.56)
After: MyNumber = -1234.56

Place the above expression in the UPDATE TO line of your query, and you should be set.






Remember, you're unique - [smile]- just like everyone else
Another free Access forum:
 
Perfect! Thanks for your timely response.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top