Microsoft Access Forums

Go Back   Microsoft Access Forums > Access Forums > Import/Export Data

Reply
 
LinkBack Thread Tools Display Modes
  #1  
Old 01-14-2010, 09:35 AM
Bjorn Bjorn is offline Windows XP Access 2003 (version 11.0)
Novice
 
Join Date: Jan 2010
Posts: 7
Bjorn is on a distinguished road
Default Link to text file containing numbers with thousand delimiter like 123.456.789,44

In Access I am linking to a textfile produced by an external system. This textfile unfortunately contains numbers with dot as thousand separator and comma as decimal symbol. Example: 123.456.789,44

I need to have this as any kind of numeric field in Access. Unlike Excels import wizard, it is not possible in Access to set the thousand separator (only the decimal symbol).

I have tried importing this as a text field, and then created a query with a calculated field like this: AdjAmount:Replace([Amount];".";"")*1
This technically works, and the "multiply by 1" automatically converts this into a number. Using this technique, I can make calculations with the field "AdjAmount" in Access and everything works and looks fine, but....

... in our company we are using the technique to get "MS Access" result via "MS Query" in Excel. From Excel (via MS Query in Excel) we link to tables och queries in Access and that works fine. Linking the the table containing the field "Amount" (as text field) also works fine. Also linking to a query just showing all fields works fine. But when linking to the query with the conversion mentioned above (Replace...), it gets hooked in MS Query when linking. I get the error message (translated from Swedish): "Couldn't access the table... [my Access database filename]". This seems like a very strange error code, and my guess is that it is because the technique used to create the field "AdjAmount" is not compatible with MS Query in Excel. Therefore I have to find another technique!

I have tried to find documentation about different "normal" conversion built-in-functions, but were not succesful. I am not very familiar with them, and I haven't found anyone after searching a litte, but here there might be a solution (or at the import stage...).

Any suggestion?

I can not keep it as text-field in MS Access (and convert it to a number in Excel), since several calculations must be done with the field AdjAmount in Access.
I can not change regional settings
I can not influence the layout of the text field
I also want to avoid too comlicated solving techniques, since this (and similar cases) will be handled by "not-too-experienced users" (they usually do import/link of tables and create queries using the normal design tool, no VBA programming, no direct SQL-writing)

Thats quite a challenge, or what do you say!?!
Reply With Quote
  #2  
Old 01-14-2010, 03:20 PM
RuralGuy's Avatar
RuralGuy RuralGuy is offline Windows 7 Access 2007 (version 12.0)
Super Moderator
 
Join Date: Mar 2007
Location: 8300' in the Colorado Rocky Mountains
Posts: 3,848
RuralGuy will become famous soon enoughRuralGuy will become famous soon enough
Default

It sounds like you have your arms around the problem, just no solution yet. It also sounds like you say you could import the value correctly into Excel because the import wizard has more parameters. How about importing into Excel first and *then* into Access from Excel?
__________________
(RG for short) aka Allan Bunch MS Access MVP - WinXP Pro, Win7 - acXP, ac07
If your issue is resolved...follow this link for directions on how to use the Solved thread tool!
Teaching is not filling a bucket but lighting a fire. Borrowed quote..."Docendo discimus"
Reply With Quote
  #3  
Old 01-15-2010, 06:11 AM
Bjorn Bjorn is offline Windows XP Access 2003 (version 11.0)
Novice
 
Join Date: Jan 2010
Posts: 7
Bjorn is on a distinguished road
Default

Hi there and thanks!
When I saw your suggestion I got a smile on my lips; so easy and still so clever!

It worked to 99%, with the very little extra "manual" work to remember (1% :-) that we have to open the first Excelfile (that links to the textfile) and "Agree to automatic updating" and then save it, otherwise a change in the textfile doesn't follow the whole link chain.

However, your solution is now implemented and a great THANK YOU !!
Reply With Quote
  #4  
Old 01-15-2010, 11:28 AM
RuralGuy's Avatar
RuralGuy RuralGuy is offline Windows 7 Access 2007 (version 12.0)
Super Moderator
 
Join Date: Mar 2007
Location: 8300' in the Colorado Rocky Mountains
Posts: 3,848
RuralGuy will become famous soon enoughRuralGuy will become famous soon enough
Default

You're very welcome and thanks for marking this thread as Solved.
__________________
(RG for short) aka Allan Bunch MS Access MVP - WinXP Pro, Win7 - acXP, ac07
If your issue is resolved...follow this link for directions on how to use the Solved thread tool!
Teaching is not filling a bucket but lighting a fire. Borrowed quote..."Docendo discimus"
Reply With Quote
Reply

Bookmarks

Tags
thousand, thousand delimitor, thousand separator

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How make numbers (options 1,2,3) in table appear as text in forms (blue, green, red)? malemozaffar Forms 9 11-23-2009 06:20 PM
Data from text file Directlinq Programming 1 10-19-2009 12:29 AM
Exporting data to text file NC_juggler Import/Export Data 0 11-21-2008 07:51 AM
Extract numbers from text string strored in a field. khabdullah Programming 2 12-23-2007 03:55 PM
Link table using MAC PC file sharing problem TaiYipStreet Access 0 07-19-2006 06:02 AM


All times are GMT -8. The time now is 08:28 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.